Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8634015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:36:44+00:00 2026-06-12T09:36:44+00:00

The Microsoft link here lists three methods that we can use. But how do

  • 0

The Microsoft link here lists three methods that we can use.

But how do we get the current namespace?
I see there is a similar question, but the answer to that is using Macros, which doesnt solve this specific question.

The NameSpace() to do something like this:

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            .
            .
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>namespace</ID> 
                    <Function>NameSpace()</Function>                     
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[
                    $namespace$
                ]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:36:45+00:00Added an answer on June 12, 2026 at 9:36 am

    Found out that it can be done and it brings into picture the classes ExpansionProvider & ExpansionFunction

    For the above snippet, I had to do something as such:

    internal class NameSpaceExpansionFunction : ExpansionFunction
        {
            public NameSpaceExpansionFunction(ExpansionProvider provider)
                : base(provider)
            {
            }
    
            public override string GetCurrentValue()
            {
               //get namespace
               return namespace;
            }
        }
    

    And the LanguageService tells the snippet file where to look for definition of the function:

    public class MyLanguageService : LanguageService
        {
            public override ExpansionFunction CreateExpansionFunction(ExpansionProvider provider,
                                                                      string functionName)
            {
                ExpansionFunction function = null;
                if (String.Compare(functionName, "NameSpace", true) == 0)
                {
                    function = new NameSpaceExpansionFunction(provider);
                }
                return function;
            }
        }
    

    This turned out to be more like a tutorial question hence I have provided the links above. Should be helpful. Worked for me 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just read this link http://msdn.microsoft.com/en-us/library/ms186243.aspx Here is the code to create table and
Hopefully someone can tell me what's going on here. I'm trying to link to
I was going through this link below: http://support.microsoft.com/kb/819267 Here it explains to enable HTTP
I checked out this link: http://msdn.microsoft.com/en-us/library/ff769510(v=VS.92).aspx But when I run the default windows phone
http://msdn.microsoft.com/en-us/library/ms181765.aspx I see the sql below from above link: SELECT BusinessEntityID, SalariedFlag FROM HumanResources.Employee
Here is MSDN link From http://msdn.microsoft.com/en-us/library/s3f49ktz(v=VS.80).aspx It says: unsigned int : 4byte Range of
was wondering if there are anyone else here that has signed up with the
http://msdn.microsoft.com/en-us/library/ms189797.aspx In this link they are committing a transaction within catch clause IF (XACT_STATE())
In general, are WCF Data Services interoperable or Microsoft specific? This ADO.NET Blog link
Microsoft recently released to preview Azure web sites. I had been hoping that this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.