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

◆ Add()

void System.Xml.Linq.Inserter.Add ( object content)
inline

Definition at line 20 of file Inserter.cs.

21 {
22 AddContent(content);
23 if (_text == null)
24 {
25 return;
26 }
27 if (_parent.content == null)
28 {
29 if (_parent.SkipNotify())
30 {
32 }
33 else if (_text.Length > 0)
34 {
35 InsertNode(new XText(_text));
36 }
37 else if (_parent is XElement)
38 {
39 _parent.NotifyChanging(_parent, XObjectChangeEventArgs.Value);
40 if (_parent.content != null)
41 {
43 }
45 _parent.NotifyChanged(_parent, XObjectChangeEventArgs.Value);
46 }
47 else
48 {
50 }
51 }
52 else if (_text.Length > 0)
53 {
54 if (_previous is XText xText && !(_previous is XCData))
55 {
57 return;
58 }
60 InsertNode(new XText(_text));
61 }
62 }
static string InvalidOperation_ExternalCode
Definition SR.cs:50
Definition SR.cs:7
bool NotifyChanging(object sender, XObjectChangeEventArgs e)
Definition XObject.cs:428
bool NotifyChanged(object sender, XObjectChangeEventArgs e)
Definition XObject.cs:399
void AddContent(object content)
Definition Inserter.cs:64
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.Inserter.AddContent(), System.Xml.Linq.XContainer.content, System.Xml.Linq.XContainer.ConvertTextToNode(), System.Xml.Dictionary, System.Xml.Linq.Inserter.InsertNode(), System.SR.InvalidOperation_ExternalCode, System.Xml.Linq.XObject.NotifyChanged(), System.Xml.Linq.XObject.NotifyChanging(), System.Xml.Linq.XObject.SkipNotify(), and System.Xml.Linq.XObjectChangeEventArgs.Value.

Referenced by System.Xml.Linq.XNode.AddAfterSelf(), System.Xml.Linq.XNode.AddBeforeSelf(), System.Xml.Linq.XContainer.AddFirst(), and System.Xml.Linq.XNode.ReplaceWith().