Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DocumentXPathNodeIterator_ElemDescendants.cs
Go to the documentation of this file.
2
3namespace System.Xml;
4
6{
7 private readonly DocumentXPathNavigator _nav;
8
9 private int _level;
10
11 private int _position;
12
13 public override XPathNavigator Current => _nav;
14
15 public override int CurrentPosition => _position;
16
23
30
31 protected abstract bool Match(XmlNode node);
32
33 protected void SetPosition(int pos)
34 {
35 _position = pos;
36 }
37
38 public override bool MoveNext()
39 {
41 do
42 {
44 {
45 _level++;
46 }
47 else
48 {
49 if (_level == 0)
50 {
51 return false;
52 }
53 while (!_nav.MoveToNext())
54 {
55 _level--;
56 if (_level == 0)
57 {
58 return false;
59 }
60 if (!_nav.MoveToParent())
61 {
62 return false;
63 }
64 }
65 }
67 }
68 while (xmlNode.NodeType != XmlNodeType.Element || !Match(xmlNode));
69 _position++;
70 return true;
71 }
72}
DocumentXPathNodeIterator_ElemDescendants(DocumentXPathNodeIterator_ElemDescendants other)