public override void VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) { var namespaceName = node.Name; NamespaceCollection.Add(namespaceName.ToString()); base.VisitNamespaceDeclaration(node); }
protected override void InitializeDefault() { ExpressionBuilderElementCollection exprBuilders = this.Compilation.ExpressionBuilders; exprBuilders.Add( new ExpressionBuilderElement(RequestExpressionBuilder.Namespace, typeof(RequestExpressionBuilder)) { LockItem = true } ); exprBuilders.Add( new ExpressionBuilderElement(SessionExpressionBuilder.Namespace, typeof(SessionExpressionBuilder)) { LockItem = true } ); exprBuilders.Add( new ExpressionBuilderElement(CodeExpressionBuilder.Namespace, typeof(CodeExpressionBuilder)) { LockItem = true } ); NamespaceCollection pagesNamespaces = this.Pages.Namespaces; pagesNamespaces.Add(new NamespaceInfo("System")); pagesNamespaces.Add(new NamespaceInfo("System.Collections.Generic")); pagesNamespaces.Add(new NamespaceInfo("System.IO")); pagesNamespaces.Add(new NamespaceInfo("System.Linq")); pagesNamespaces.Add(new NamespaceInfo("System.Net")); pagesNamespaces.Add(new NamespaceInfo("System.Web")); pagesNamespaces.Add(new NamespaceInfo("System.Web.Security")); pagesNamespaces.Add(new NamespaceInfo("System.Web.UI")); base.InitializeDefault(); }
/// <summary> /// Answer a collection of namespaces in which the topic actually exists /// </summary> /// <param name="topic">The topic you want to search for in this namespace.</param> /// <returns>A list of namespaces (as strings); empty if none</returns> public NamespaceCollection TopicNamespaces(string topic) { NamespaceCollection answer = new NamespaceCollection(); if (TopicExists(topic, ImportPolicy.DoNotIncludeImports)) { answer.Add(Namespace); } foreach (NamespaceManager manager in ImportedNamespaceManagers) { if (manager.TopicExists(topic, ImportPolicy.DoNotIncludeImports)) { answer.Add(manager.Namespace); } } return answer; }