示例#1
0
 internal NamespaceScopeImpl(CodeWorkspaceImpl ws, INamespaceScope?parent, string name)
     : base(ws, parent)
 {
     Debug.Assert((parent == null) == (name.Length == 0));
     Debug.Assert(parent == null || parent is NamespaceScopeImpl);
     _usings          = new Dictionary <string, KeyValuePair <string?, string?> >();
     _subNamespaces   = new List <NamespaceScopeImpl>();
     _beforeNamespace = new CodePartRaw();
     if (parent != null)
     {
         SetName(name);
     }
 }
示例#2
0
        public ICodePart CreatePart(bool top = false)
        {
            var p = new CodePartRaw();

            if (top)
            {
                Parts.Insert(0, p);
            }
            else
            {
                Parts.Add(p);
            }
            return(p);
        }