Inheritance: SimpleNamespace
Beispiel #1
0
        GlobalNamespace GetGlobalNamespace()
        {
            INamespace      ns      = _global;
            GlobalNamespace globals = ns as GlobalNamespace;

            while (globals == null && ns != null)
            {
                ns      = ns.ParentNamespace;
                globals = ns as GlobalNamespace;
            }
            return(globals);
        }
Beispiel #2
0
        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);
        }