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

◆ GetInitialTextFromNodes()

static string System.Xml.RegionIterator.GetInitialTextFromNodes ( ref XmlNode n)
inlinestaticprivate

Definition at line 83 of file RegionIterator.cs.

84 {
85 string text = null;
86 if (n != null)
87 {
88 while (n.NodeType == XmlNodeType.Whitespace)
89 {
90 n = n.NextSibling;
91 if (n == null)
92 {
93 return string.Empty;
94 }
95 }
96 if (XmlDataDocument.IsTextLikeNode(n) && (n.NextSibling == null || !XmlDataDocument.IsTextLikeNode(n.NextSibling)))
97 {
98 text = n.Value;
99 n = n.NextSibling;
100 }
101 else
102 {
104 while (n != null && XmlDataDocument.IsTextLikeNode(n))
105 {
106 if (n.NodeType != XmlNodeType.Whitespace)
107 {
108 stringBuilder.Append(n.Value);
109 }
110 n = n.NextSibling;
111 }
112 text = stringBuilder.ToString();
113 }
114 }
115 return text ?? string.Empty;
116 }

References System.Xml.Dictionary, System.Xml.XmlDataDocument.IsTextLikeNode(), and System.text.

Referenced by System.Xml.RegionIterator.NextInitialTextLikeNodes().