internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc)
 {
     XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(newChild, this);
     if (insertEventArgsForLoad != null)
     {
         doc.BeforeEvent(insertEventArgsForLoad);
     }
     XmlLinkedNode nextNode = (XmlLinkedNode) newChild;
     if ((this.lastChild == null) || (this.lastChild == this))
     {
         nextNode.next = nextNode;
         this.lastChild = nextNode;
         nextNode.SetParentForLoad(this);
     }
     else
     {
         XmlLinkedNode lastChild = this.lastChild;
         nextNode.next = lastChild.next;
         lastChild.next = nextNode;
         this.lastChild = nextNode;
         if (lastChild.IsText && nextNode.IsText)
         {
             XmlNode.NestTextNodes(lastChild, nextNode);
         }
         else
         {
             nextNode.SetParentForLoad(this);
         }
     }
     if (insertEventArgsForLoad != null)
     {
         doc.AfterEvent(insertEventArgsForLoad);
     }
     return nextNode;
 }
 internal virtual XmlNode AddNodeForLoad(XmlNode node, XmlDocument doc)
 {
     XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(node, this.parent);
     if (insertEventArgsForLoad != null)
     {
         doc.BeforeEvent(insertEventArgsForLoad);
     }
     this.Nodes.Add(node);
     node.SetParent(this.parent);
     if (insertEventArgsForLoad != null)
     {
         doc.AfterEvent(insertEventArgsForLoad);
     }
     return node;
 }
        //the function is provided only at Load time to speed up Load process
        internal override XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) {
            XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );

            if (args != null)
                doc.BeforeEvent( args );

            XmlLinkedNode newNode = (XmlLinkedNode)newChild;

            if (lastChild == null) { // if LastNode == null
                newNode.next = newNode;
                lastChild = newNode;
                newNode.SetParentForLoad(this);
            }
            else {
                XmlLinkedNode refNode = lastChild; // refNode = LastNode;
                newNode.next = refNode.next;
                refNode.next = newNode;
                lastChild = newNode; // LastNode = newNode;
                if (refNode.IsText
                    && newNode.IsText) {
                    NestTextNodes(refNode, newNode);
                }
                else {
                    newNode.SetParentForLoad(this);
                }
            }

            if (args != null)
                doc.AfterEvent( args );

            return newNode;
        }
Example #4
0
 internal virtual XmlNode AddNodeForLoad(XmlNode node, XmlDocument doc) {
     XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad(node, parent);
     if (args != null) {
         doc.BeforeEvent(args);
     }
     nodes.Add(node);
     node.SetParent(parent);
     if (args != null) {
         doc.AfterEvent(args);
     }
     return node;
 }
Example #5
0
        //the function is provided only at Load time to speed up Load process
        internal virtual XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc) {
            XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );

            if (args != null)
                doc.BeforeEvent( args );

            XmlLinkedNode newNode = (XmlLinkedNode) newChild;

            if (LastNode == null) {
                newNode.next = newNode;
            }
            else {
                newNode.next = LastNode.next;
                LastNode.next = newNode;
            }

            LastNode = newNode;
            newNode.SetParentForLoad( this );

            if (args != null)
                doc.AfterEvent( args );

            return newNode;
        }
Example #6
0
        internal override XmlNode AppendChildForLoad( XmlNode newChild, XmlDocument doc ) {
            XmlNodeChangedEventArgs args = doc.GetInsertEventArgsForLoad( newChild, this );

            if (args != null)
                doc.BeforeEvent( args );

            XmlLinkedNode newNode = (XmlLinkedNode) newChild;

            if (lastChild == null || lastChild == emptyElem) {
                newNode.next = newNode;
            }
            else {
                newNode.next = lastChild.next;
                lastChild.next = newNode;
            }

            lastChild = newNode;
            newNode.SetParentForLoad( this );

            if (args != null)
                doc.AfterEvent( args );

            return newNode;
        }