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

◆ GetDescendants()

IEnumerable< XElement > System.Xml.Linq.XContainer.GetDescendants ( XName name,
bool self )
inlinepackageinherited

Definition at line 1043 of file XContainer.cs.

1044 {
1045 if (self)
1046 {
1047 XElement xElement = (XElement)this;
1048 if (name == null || xElement.name == name)
1049 {
1050 yield return xElement;
1051 }
1052 }
1053 XNode i = this;
1054 XContainer xContainer = this;
1055 while (true)
1056 {
1057 if (xContainer != null && xContainer.content is XNode)
1058 {
1059 i = ((XNode)xContainer.content).next;
1060 }
1061 else
1062 {
1063 while (i != this && i == i.parent.content)
1064 {
1065 i = i.parent;
1066 }
1067 if (i == this)
1068 {
1069 break;
1070 }
1071 i = i.next;
1072 }
1073 XElement e = i as XElement;
1074 if (e != null && (name == null || e.name == name))
1075 {
1076 yield return e;
1077 }
1078 xContainer = e;
1079 }
1080 }

References System.Xml.Linq.XNode.XNode(), System.Xml.Dictionary, and System.Xml.Linq.XElement.name.

Referenced by System.Xml.Linq.XContainer.Descendants(), System.Xml.Linq.XContainer.Descendants(), System.Xml.Linq.XElement.DescendantsAndSelf(), and System.Xml.Linq.XElement.DescendantsAndSelf().