예제 #1
0
        public INameSpaceDeclaration AddNew(string name)
        {
            INameSpaceDeclaration result = new NameSpaceDeclaration(name, this.targetDeclaration);

            this._Add(name, result);
            return(result);
        }
예제 #2
0
 public INameSpaceDeclaration AddNew(INameSpaceParent parentTarget)
 {
     if ((parentTarget is ISegmentableDeclarationTarget && this.RootDeclaration.ParentTarget is ISegmentableDeclarationTarget && ((ISegmentableDeclarationTarget)parentTarget).GetRootDeclaration().Equals(((ISegmentableDeclarationTarget)(this.RootDeclaration.ParentTarget)).GetRootDeclaration())) || parentTarget == this.RootDeclaration.ParentTarget)
     {
         INameSpaceDeclaration partial = new NameSpaceDeclaration(this.RootDeclaration, parentTarget);
         base.baseList.Add(partial);
         return(partial);
     }
     throw new InvalidOperationException("Type-hierarchy must be identical to the root declaration");
 }
예제 #3
0
        public INameSpaceDeclaration AddNew()
        {
            INameSpaceDeclaration newNameSpace = null;

            if (this.RootDeclaration.ParentTarget is INameSpaceDeclaration)
            {
                newNameSpace = new NameSpaceDeclaration(this.RootDeclaration, ((INameSpaceDeclaration)this.RootDeclaration.ParentTarget).Partials.AddNew());
            }
            else if (this.RootDeclaration.ParentTarget is IIntermediateProject)
            {
                newNameSpace = new NameSpaceDeclaration(this.RootDeclaration, ((IIntermediateProject)this.RootDeclaration.ParentTarget).Partials.AddNew());
            }
            else
            {
                newNameSpace = new NameSpaceDeclaration(this.RootDeclaration, this.RootDeclaration.ParentTarget);
            }
            this.baseList.Add(newNameSpace);
            return(newNameSpace);
        }