Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlChildNodes.cs
Go to the documentation of this file.
2
3namespace System.Xml;
4
5internal sealed class XmlChildNodes : XmlNodeList
6{
7 private readonly XmlNode _container;
8
9 public override int Count
10 {
11 get
12 {
13 int num = 0;
14 for (XmlNode xmlNode = _container.FirstChild; xmlNode != null; xmlNode = xmlNode.NextSibling)
15 {
16 num++;
17 }
18 return num;
19 }
20 }
21
22 public XmlChildNodes(XmlNode container)
23 {
24 _container = container;
25 }
26
27 public override XmlNode Item(int i)
28 {
29 if (i < 0)
30 {
31 return null;
32 }
34 while (xmlNode != null)
35 {
36 if (i == 0)
37 {
38 return xmlNode;
39 }
41 i--;
42 }
43 return null;
44 }
45
46 public override IEnumerator GetEnumerator()
47 {
48 if (_container.FirstChild == null)
49 {
51 }
53 }
54}
XmlChildNodes(XmlNode container)
override XmlNode Item(int i)
readonly XmlNode _container
override IEnumerator GetEnumerator()
static EmptyEnumerator EmptyEnumerator
virtual ? XmlNode NextSibling
Definition XmlNode.cs:104
virtual ? XmlNode FirstChild
Definition XmlNode.cs:120