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

◆ Advance()

override XPathNavigator MS.Internal.Xml.XPath.PrecedingQuery.Advance ( )
inline

Definition at line 33 of file PrecedingQuery.cs.

34 {
35 if (_workIterator == null)
36 {
37 XPathNavigator xPathNavigator = qyInput.Advance();
38 if (xPathNavigator == null)
39 {
40 return null;
41 }
42 XPathNavigator xPathNavigator2 = xPathNavigator.Clone();
43 do
44 {
45 xPathNavigator2.MoveTo(xPathNavigator);
46 }
47 while ((xPathNavigator = qyInput.Advance()) != null);
48 if (xPathNavigator2.NodeType == XPathNodeType.Attribute || xPathNavigator2.NodeType == XPathNodeType.Namespace)
49 {
50 xPathNavigator2.MoveToParent();
51 }
52 do
53 {
54 _ancestorStk.Push(xPathNavigator2.Clone());
55 }
56 while (xPathNavigator2.MoveToParent());
57 _workIterator = xPathNavigator2.SelectDescendants(XPathNodeType.All, matchSelf: true);
58 }
59 while (_workIterator.MoveNext())
60 {
63 {
65 if (_ancestorStk.Count == 0)
66 {
67 currentNode = null;
68 _workIterator = null;
69 return null;
70 }
71 }
72 else if (matches(currentNode))
73 {
74 position++;
75 return currentNode;
76 }
77 }
78 return null;
79 }
virtual bool matches(XPathNavigator e)
readonly ClonableStack< XPathNavigator > _ancestorStk
XPathNavigator Advance()
bool MoveTo(XPathNavigator other)
bool IsSamePosition(XPathNavigator other)
virtual XPathNodeIterator SelectDescendants(XPathNodeType type, bool matchSelf)

References MS.Internal.Xml.XPath.PrecedingQuery._ancestorStk, MS.Internal.Xml.XPath.PrecedingQuery._workIterator, MS.Internal.Xml.XPath.Query.Advance(), System.Xml.XPath.XPathNavigator.Clone(), System.Xml.XPath.XPathNodeIterator.Current, MS.Internal.Xml.XPath.BaseAxisQuery.currentNode, System.Xml.XPath.XPathNavigator.IsSamePosition(), MS.Internal.Xml.XPath.BaseAxisQuery.matches(), System.Xml.XPath.XPathNodeIterator.MoveNext(), System.Xml.XPath.XPathNavigator.MoveTo(), System.Xml.XPath.XPathNavigator.MoveToParent(), System.Xml.XPath.XPathNavigator.NodeType, MS.Internal.Xml.XPath.ClonableStack< T >.Peek(), MS.Internal.Xml.XPath.ClonableStack< T >.Pop(), MS.Internal.Xml.XPath.BaseAxisQuery.position, MS.Internal.Xml.XPath.ClonableStack< T >.Push(), MS.Internal.Xml.XPath.BaseAxisQuery.qyInput, and System.Xml.XPath.XPathNavigator.SelectDescendants().