本文整理汇总了C#中INamespace类的典型用法代码示例。如果您正苦于以下问题:C# INamespace类的具体用法?C# INamespace怎么用?C# INamespace使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INamespace类属于命名空间,在下文中一共展示了INamespace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddNamespace
public static void AddNamespace(INamespace ns)
{
if (ns == null)
throw new ArgumentNullException("ns");
namespaces[ns.Identifier] = ns;
}
示例2: ResolveQualifiedNameToSingle
public static IEntity ResolveQualifiedNameToSingle(INamespace root, string qualifiedName)
{
IEntity current = root;
foreach (string part in qualifiedName.Split('.'))
current = ResolveSingle((INamespace) current, part);
return current;
}
示例3: AddNamespace
public void AddNamespace (INamespace ns)
{
if (usedNamespaces.Contains (ns.Name))
return;
usedNamespaces.Add (ns.Name);
result.Add (Factory.CreateNamespaceCompletionData (ns));
}
示例4: CodeNamespace
public CodeNamespace(CodeModelContext context, INamespace ns)
: base(context)
{
this.ns = ns;
this.InfoLocation = global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal;
this.Language = context.CurrentProject.GetCodeModelLanguage();
}
示例5: ResolveCoalescingNamespaces
public static bool ResolveCoalescingNamespaces(INamespace parent, INamespace namespaceToResolveAgainst, string name, EntityType typesToConsider, ICollection<IEntity> resultingSet)
{
var resolved = new Set<IEntity>();
if (!namespaceToResolveAgainst.Resolve(resolved, name, typesToConsider))
return false;
return CoalesceResolved(resolved, parent, name, resultingSet);
}
示例6: ResolveSingle
public static IEntity ResolveSingle(INamespace root, string name)
{
var resolved = new List<IEntity>();
Assert.IsTrue(root.Resolve(resolved, name, EntityType.Any), "Failed to resolve '{0}' against '{1}'", name, root);
Assert.AreEqual(1, resolved.Count);
return resolved[0];
}
示例7: FindReferences
AstNode[] FindReferences(INamespace ns)
{
var result = new List<AstNode>();
var searchScopes = findReferences.GetSearchScopes(ns);
findReferences.FindReferencesInFile(searchScopes, unresolvedFile, syntaxTree, compilation,
(node, rr) => result.Add(node), CancellationToken.None);
return result.OrderBy(n => n.StartLocation).ToArray();
}
示例8: SetChild
public void SetChild(string name, INamespace entity)
{
_children[name] = entity;
if (name == "")
{
_empty = entity;
}
}
示例9: NamespaceDelegator
public NamespaceDelegator(INamespace parent, params INamespace[] namespaces)
{
if (null == namespaces)
{
throw new ArgumentNullException("namespaces");
}
_parent = parent;
_namespaces = namespaces;
}
示例10: NamespaceEntity
public NamespaceEntity(INamespace parent, TypeSystemServices tagManager, string name)
{
_parent = parent;
_typeSystemServices = tagManager;
_name = name;
_assemblies = new Dictionary<Assembly, Dictionary<string, List<Type>>>(AssemblyEqualityComparer.Default);
_childrenNamespaces = new Dictionary<string, NamespaceEntity>();
_internalModules = new List<ModuleEntity>();
_externalModules = new List<ExternalType>();
示例11: GlobalNamespace
public GlobalNamespace(IDictionary children)
: base(null, children)
{
_empty = (INamespace)children[""];
if (null == _empty)
{
_empty = NullNamespace.Default;
}
}
示例12: SimpleNamespace
public SimpleNamespace(INamespace parent, IDictionary children)
{
if (null == children)
{
throw new ArgumentNullException("children");
}
_parent = parent;
_children = children;
}
示例13: IsAccessible
bool IsAccessible(MemberLookup lookup, INamespace ns)
{
if (ns.Types.Any (t => lookup.IsAccessible (t, false)))
return true;
foreach (var child in ns.ChildNamespaces)
if (IsAccessible (lookup, child))
return true;
return false;
}
示例14: MergedNamespace
/// <summary>
/// Creates a new merged root namespace.
/// </summary>
/// <param name="compilation">The main compilation.</param>
/// <param name="namespaces">The individual namespaces being merged.</param>
/// <param name="externAlias">The extern alias for this namespace.</param>
public MergedNamespace(ICompilation compilation, INamespace[] namespaces, string externAlias = null)
{
if (compilation == null)
throw new ArgumentNullException("compilation");
if (namespaces == null)
throw new ArgumentNullException("namespaces");
this.compilation = compilation;
this.namespaces = namespaces;
this.externAlias = externAlias;
}
示例15: ResolveQualifiedName
public static Set<IEntity> ResolveQualifiedName(INamespace root, string qualifiedName)
{
INamespace current = root;
string[] parts = qualifiedName.Split('.');
for (int i=0; i < parts.Length - 1; ++i)
current = (INamespace) ResolveSingle(current, parts[i]);
var result = new Set<IEntity>();
current.Resolve(result, parts[parts.Length - 1], EntityType.Any);
return result;
}