Boo.Lang.Compiler.TypeSystem.GlobalNamespace.SetChild C# (CSharp) Method

SetChild() public method

public SetChild ( string name, INamespace entity ) : void
name string
entity INamespace
return void
        public void SetChild(string name, INamespace entity)
        {
            _children[name] = entity;
            if (name == "")
            {
                _empty = entity;
            }
        }

Usage Example

Example #1
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);
        }