NamespaceEntity GetTopLevelNamespace(string topLevelName) { GlobalNamespace globalNS = GetGlobalNamespace(); if (globalNS == null) { return(null); } NamespaceEntity entity = (NamespaceEntity)globalNS.GetChild(topLevelName); if (null == entity) { entity = new NamespaceEntity(null, _context.TypeSystemServices, topLevelName); globalNS.SetChild(topLevelName, entity); } return(entity); }
internal bool Resolve(List targetList, string name, Assembly assembly, EntityType flags) { NamespaceEntity tag = (NamespaceEntity)_childrenNamespaces[name]; if (null != tag) { targetList.Add(new AssemblyQualifiedNamespaceEntity(assembly, tag)); return(true); } List types = (List)_assemblies[assembly]; bool found = false; if (null != types) { foreach (Type type in types) { if (name == type.Name) { targetList.Add(_typeSystemServices.Map(type)); found = true; break; } } foreach (ExternalType external in _externalModules) { if (external.ActualType.Assembly == assembly) { found |= external.Resolve(targetList, name, flags); } } } return(found); }
public AssemblyQualifiedNamespaceEntity(Assembly assembly, NamespaceEntity subject) { _assembly = assembly; _subject = subject; }
public NamespaceEntity GetChildNamespace(string name) { NamespaceEntity tag; _childrenNamespaces.TryGetValue(name, out tag); if (null == tag) { tag = new NamespaceEntity(this, _typeSystemServices, _name + "." + name); _childrenNamespaces[name] = tag; } return tag;
NamespaceEntity GetTopLevelNamespace(string topLevelName) { GlobalNamespace globalNS = GetGlobalNamespace(); if (globalNS == null) return null; NamespaceEntity entity = (NamespaceEntity)globalNS.GetChild(topLevelName); if (null == entity) { entity = new NamespaceEntity(null, _context.TypeSystemServices, topLevelName); globalNS.SetChild(topLevelName, entity); } return entity; }