Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathNodeList.cs
Go to the documentation of this file.
4
5namespace System.Xml;
6
7internal sealed class XPathNodeList : XmlNodeList
8{
9 private readonly List<XmlNode> _list;
10
12
13 private bool _done;
14
15 public override int Count
16 {
17 get
18 {
19 if (!_done)
20 {
21 ReadUntil(int.MaxValue);
22 }
23 return _list.Count;
24 }
25 }
26
33
35 {
37 return hasXmlNode.GetNode();
38 }
39
40 internal int ReadUntil(int index)
41 {
42 int num = _list.Count;
43 while (!_done && num <= index)
44 {
46 {
48 if (node != null)
49 {
50 _list.Add(node);
51 num++;
52 }
53 continue;
54 }
55 _done = true;
56 break;
57 }
58 return num;
59 }
60
61 public override XmlNode Item(int index)
62 {
63 if (_list.Count <= index)
64 {
66 }
67 if (index < 0 || _list.Count <= index)
68 {
69 return null;
70 }
71 return _list[index];
72 }
73
74 public override IEnumerator GetEnumerator()
75 {
76 return new XmlNodeListEnumerator(this);
77 }
78}
void Add(TKey key, TValue value)
override IEnumerator GetEnumerator()
readonly XPathNodeIterator _nodeIterator
override XmlNode Item(int index)
XPathNodeList(XPathNodeIterator nodeIterator)
readonly List< XmlNode > _list
XmlNode GetNode(XPathNavigator n)