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

◆ AddNode()

void System.Xml.Linq.Inserter.AddNode ( XNode n)
inlineprivate

Definition at line 111 of file Inserter.cs.

112 {
114 if (n.parent != null)
115 {
116 n = n.CloneNode();
117 }
118 else
119 {
120 XNode parent = _parent;
121 while (parent.parent != null)
122 {
123 parent = parent.parent;
124 }
125 if (n == parent)
126 {
127 n = n.CloneNode();
128 }
129 }
131 if (_text != null)
132 {
133 if (_text.Length > 0)
134 {
135 if (_previous is XText xText && !(_previous is XCData))
136 {
138 }
139 else
140 {
141 InsertNode(new XText(_text));
142 }
143 }
144 _text = null;
145 }
146 InsertNode(n);
147 }
virtual void ValidateNode(XNode node, XNode previous)
XContainer parent
Definition XObject.cs:7
readonly XContainer _parent
Definition Inserter.cs:7
void InsertNode(XNode n)
Definition Inserter.cs:155

References System.Xml.Linq.Inserter._parent, System.Xml.Linq.Inserter._previous, System.Xml.Linq.Inserter._text, System.Xml.Linq.XNode.CloneNode(), System.Xml.Linq.XContainer.ConvertTextToNode(), System.Xml.Dictionary, System.Xml.Linq.Inserter.InsertNode(), System.Xml.Linq.XObject.parent, and System.Xml.Linq.XContainer.ValidateNode().

Referenced by System.Xml.Linq.Inserter.AddContent().