Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ InsertAfter()

virtual ? XmlNode System.Xml.XmlNode.InsertAfter ( XmlNode newChild,
XmlNode? refChild )
inlinevirtualinherited

Reimplemented in System.Xml.XmlAttribute.

Definition at line 548 of file XmlNode.cs.

549 {
550 if (this == newChild || AncestorNode(newChild))
551 {
553 }
554 if (refChild == null)
555 {
556 return PrependChild(newChild);
557 }
558 if (!IsContainer)
559 {
561 }
562 if (refChild.ParentNode != this)
563 {
565 }
566 if (newChild == refChild)
567 {
568 return newChild;
569 }
570 XmlDocument ownerDocument = newChild.OwnerDocument;
571 XmlDocument ownerDocument2 = OwnerDocument;
572 if (ownerDocument != null && ownerDocument != ownerDocument2 && ownerDocument != this)
573 {
575 }
577 {
579 }
580 if (newChild.ParentNode != null)
581 {
582 newChild.ParentNode.RemoveChild(newChild);
583 }
584 if (newChild.NodeType == XmlNodeType.DocumentFragment)
585 {
587 XmlNode firstChild = newChild.FirstChild;
589 while (xmlNode != null)
590 {
591 XmlNode nextSibling = xmlNode.NextSibling;
592 newChild.RemoveChild(xmlNode);
596 }
597 return firstChild;
598 }
599 if (!(newChild is XmlLinkedNode) || !IsValidChildType(newChild.NodeType))
600 {
602 }
603 XmlLinkedNode xmlLinkedNode = (XmlLinkedNode)newChild;
604 XmlLinkedNode xmlLinkedNode2 = (XmlLinkedNode)refChild;
605 string value = newChild.Value;
606 XmlNodeChangedEventArgs eventArgs = GetEventArgs(newChild, newChild.ParentNode, this, value, value, XmlNodeChangedAction.Insert);
607 if (eventArgs != null)
608 {
610 }
612 {
617 if (xmlLinkedNode2.IsText && xmlLinkedNode.IsText)
618 {
620 }
621 }
622 else
623 {
624 XmlLinkedNode xmlLinkedNode3 = (xmlLinkedNode.next = xmlLinkedNode2.next);
626 xmlLinkedNode.SetParent(this);
627 if (xmlLinkedNode2.IsText)
628 {
629 if (xmlLinkedNode.IsText)
630 {
632 if (xmlLinkedNode3.IsText)
633 {
635 }
636 }
637 else if (xmlLinkedNode3.IsText)
638 {
640 }
641 }
642 else if (xmlLinkedNode.IsText && xmlLinkedNode3.IsText)
643 {
645 }
646 }
647 if (eventArgs != null)
648 {
650 }
651 return xmlLinkedNode;
652 }
static string Xdom_Node_Insert_Contain
Definition SR.cs:1330
static string Xdom_Node_Insert_TypeConflict
Definition SR.cs:1338
static string Xdom_Node_Insert_Context
Definition SR.cs:1334
static string Xdom_Node_Insert_Child
Definition SR.cs:1328
static string Xdom_Node_Insert_Location
Definition SR.cs:1336
static string Xdom_Node_Insert_Path
Definition SR.cs:1332
Definition SR.cs:7
virtual XmlNodeChangedEventArgs GetEventArgs(XmlNode node, XmlNode oldParent, XmlNode newParent, string oldValue, string newValue, XmlNodeChangedAction action)
Definition XmlNode.cs:1239
bool AncestorNode(XmlNode node)
Definition XmlNode.cs:421
virtual bool CanInsertAfter(XmlNode newChild, XmlNode refChild)
Definition XmlNode.cs:862
virtual bool IsContainer
Definition XmlNode.cs:124
static void NestTextNodes(XmlNode prevNode, XmlNode nextNode)
Definition XmlNode.cs:1274
virtual void AfterEvent(XmlNodeChangedEventArgs args)
Definition XmlNode.cs:1261
virtual void BeforeEvent(XmlNodeChangedEventArgs args)
Definition XmlNode.cs:1253
virtual bool IsValidChildType(XmlNodeType type)
Definition XmlNode.cs:852
static void UnnestTextNodes(XmlNode prevNode, XmlNode nextNode)
Definition XmlNode.cs:1279
virtual ? XmlNode InsertAfter(XmlNode newChild, XmlNode? refChild)
Definition XmlNode.cs:548
virtual ? XmlDocument OwnerDocument
Definition XmlNode.cs:109
virtual ? XmlLinkedNode LastNode
Definition XmlNode.cs:127
virtual void SetParent(XmlNode node)
Definition XmlNode.cs:1195

References System.Xml.XmlNode.AfterEvent(), System.Xml.XmlNode.AncestorNode(), System.Xml.ArgumentException, System.Xml.XmlNode.BeforeEvent(), System.Xml.XmlNode.CanInsertAfter(), System.Xml.Dictionary, System.Xml.XmlNode.FirstChild, System.Xml.XmlNode.GetEventArgs(), System.Xml.XmlNode.InsertAfter(), System.Xml.XmlNode.IsContainer, System.Xml.XmlNode.IsValidChildType(), System.Xml.XmlNode.LastNode, System.Xml.XmlNode.NestTextNodes(), System.Xml.XmlNode.NextSibling, System.Xml.XmlDocument.OwnerDocument, System.Xml.XmlNode.OwnerDocument, System.Xml.PrependChild, System.Xml.XmlNode.RemoveChild(), System.Xml.XmlNode.SetParent(), System.Xml.XmlNode.UnnestTextNodes(), System.value, System.Xml.XmlNode.Value, System.SR.Xdom_Node_Insert_Child, System.SR.Xdom_Node_Insert_Contain, System.SR.Xdom_Node_Insert_Context, System.SR.Xdom_Node_Insert_Location, System.SR.Xdom_Node_Insert_Path, and System.SR.Xdom_Node_Insert_TypeConflict.

Referenced by System.Xml.DocumentXmlWriter.Close(), System.Xml.DocumentXmlWriter.CloseWithReplaceToFollowingSibling(), System.Data.XmlTreeGen.HandleTable(), System.Xml.XmlUnspecifiedAttribute.InsertAfter(), System.Xml.XmlAttribute.InsertAfter(), System.Xml.XmlNode.InsertAfter(), System.Xml.XmlNode.InsertBefore(), and System.Xml.XmlText.SplitText().