BeforeEvent() private method

private BeforeEvent ( XmlNodeChangedEventArgs args ) : void
args XmlNodeChangedEventArgs
return void
 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;
 }
Example #2
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 #3
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);
        }
 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;
 }
Example #5
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);
        }
        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);
        }
Example #7
0
        //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 ||
                _lastChild == this)
            {                           // if LastNode == null
                newNode.next = newNode;
                _lastChild   = newNode; // LastNode = 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);
        }
        internal virtual XmlNode AppendChildForLoad(XmlNode newChild, XmlDocument doc)
        {
            XmlNodeChangedEventArgs insertEventArgsForLoad = doc.GetInsertEventArgsForLoad(newChild, this);

            if (insertEventArgsForLoad != null)
            {
                doc.BeforeEvent(insertEventArgsForLoad);
            }
            XmlLinkedNode lastNode = this.LastNode;
            XmlLinkedNode nextNode = (XmlLinkedNode)newChild;

            if (lastNode == null)
            {
                nextNode.next = nextNode;
                this.LastNode = nextNode;
                nextNode.SetParentForLoad(this);
            }
            else
            {
                nextNode.next = lastNode.next;
                lastNode.next = nextNode;
                this.LastNode = nextNode;
                if (lastNode.IsText && nextNode.IsText)
                {
                    NestTextNodes(lastNode, nextNode);
                }
                else
                {
                    nextNode.SetParentForLoad(this);
                }
            }
            if (insertEventArgsForLoad != null)
            {
                doc.AfterEvent(insertEventArgsForLoad);
            }
            return(nextNode);
        }
        //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 #10
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 #11
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 #12
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;
        }