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

◆ AppendChild()

virtual ? XmlNode System.Xml.XmlNode.AppendChild ( XmlNode newChild)
inlinevirtualinherited

Reimplemented in System.Xml.XmlBoundElement, System.Xml.XmlAttribute, and System.Xml.XmlUnspecifiedAttribute.

Definition at line 739 of file XmlNode.cs.

740 {
741 XmlDocument xmlDocument = OwnerDocument;
742 if (xmlDocument == null)
743 {
744 xmlDocument = this as XmlDocument;
745 }
746 if (!IsContainer)
747 {
749 }
750 if (this == newChild || AncestorNode(newChild))
751 {
753 }
754 if (newChild.ParentNode != null)
755 {
756 newChild.ParentNode.RemoveChild(newChild);
757 }
758 XmlDocument ownerDocument = newChild.OwnerDocument;
759 if (ownerDocument != null && ownerDocument != xmlDocument && ownerDocument != this)
760 {
762 }
763 if (newChild.NodeType == XmlNodeType.DocumentFragment)
764 {
765 XmlNode firstChild = newChild.FirstChild;
767 while (xmlNode != null)
768 {
769 XmlNode nextSibling = xmlNode.NextSibling;
770 newChild.RemoveChild(xmlNode);
773 }
774 return firstChild;
775 }
776 if (!(newChild is XmlLinkedNode) || !IsValidChildType(newChild.NodeType))
777 {
779 }
781 {
783 }
784 string value = newChild.Value;
785 XmlNodeChangedEventArgs eventArgs = GetEventArgs(newChild, newChild.ParentNode, this, value, value, XmlNodeChangedAction.Insert);
786 if (eventArgs != null)
787 {
789 }
790 XmlLinkedNode lastNode = LastNode;
791 XmlLinkedNode xmlLinkedNode = (XmlLinkedNode)newChild;
792 if (lastNode == null)
793 {
797 }
798 else
799 {
804 if (lastNode.IsText && xmlLinkedNode.IsText)
805 {
807 }
808 }
809 if (eventArgs != null)
810 {
812 }
813 return xmlLinkedNode;
814 }
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
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
virtual ? XmlDocument OwnerDocument
Definition XmlNode.cs:109
virtual ? XmlNode LastChild
Definition XmlNode.cs:122
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.AppendChild, 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.IsContainer, System.Xml.XmlNode.IsValidChildType(), System.Xml.XmlNode.LastChild, System.Xml.XmlNode.LastNode, System.Xml.XmlNode.NestTextNodes(), System.Xml.XmlNode.NextSibling, System.Xml.XmlDocument.OwnerDocument, System.Xml.XmlNode.OwnerDocument, System.Xml.XmlNode.RemoveChild(), System.Xml.XmlNode.SetParent(), System.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, and System.SR.Xdom_Node_Insert_TypeConflict.

Referenced by System.Xml.DocumentXmlWriter.AddChild(), System.Xml.XmlAttribute.AppendChild(), System.Xml.XmlUnspecifiedAttribute.AppendChild(), System.Xml.DocumentXmlWriter.Close(), System.Data.XmlTreeGen.FillDataSetElement(), System.Data.XmlTreeGen.HandleColumnType(), System.Data.XmlTreeGen.HandleTable(), System.Xml.Schema.Parser.LoadAttributeNode(), System.Xml.Schema.Parser.LoadElementNode(), System.Xml.XmlDataDocument.OnAddRow(), System.Xml.XmlDataDocument.OnNestedParentChange(), System.Xml.Schema.Parser.ProcessAppInfoDocMarkup(), System.Xml.XmlDataDocument.ReplaceInitialChildText(), System.Data.XmlTreeGen.SchemaTree(), and System.Data.XmlTreeGen.SchemaTree().