Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DescendantOverDescendantQuery.cs
Go to the documentation of this file.
1
using
System.Xml.XPath
;
2
3
namespace
MS.Internal.Xml.XPath
;
4
5
internal
sealed
class
DescendantOverDescendantQuery
:
DescendantBaseQuery
6
{
7
private
int
_level
;
8
9
public
DescendantOverDescendantQuery
(
Query
qyParent,
bool
matchSelf
,
string
name,
string
prefix,
XPathNodeType
typeTest,
bool
abbrAxis
)
10
: base(qyParent, name, prefix, typeTest,
matchSelf
,
abbrAxis
)
11
{
12
}
13
14
private
DescendantOverDescendantQuery
(
DescendantOverDescendantQuery
other)
15
: base(other)
16
{
17
_level
= other._level;
18
}
19
20
public
override
void
Reset
()
21
{
22
_level
= 0;
23
base.Reset();
24
}
25
26
public
override
XPathNavigator
Advance
()
27
{
28
while
(
true
)
29
{
30
if
(
_level
== 0)
31
{
32
currentNode
=
qyInput
.
Advance
();
33
position
= 0;
34
if
(
currentNode
==
null
)
35
{
36
return
null
;
37
}
38
if
(
matchSelf
&&
matches
(
currentNode
))
39
{
40
break
;
41
}
42
currentNode
=
currentNode
.
Clone
();
43
if
(!
MoveToFirstChild
())
44
{
45
continue
;
46
}
47
}
48
else
if
(!
MoveUpUntilNext
())
49
{
50
continue
;
51
}
52
do
53
{
54
if
(
matches
(
currentNode
))
55
{
56
position
++;
57
return
currentNode
;
58
}
59
}
60
while
(
MoveToFirstChild
());
61
}
62
position
= 1;
63
return
currentNode
;
64
}
65
66
private
bool
MoveToFirstChild
()
67
{
68
if
(
currentNode
.
MoveToFirstChild
())
69
{
70
_level
++;
71
return
true
;
72
}
73
return
false
;
74
}
75
76
private
bool
MoveUpUntilNext
()
77
{
78
while
(!
currentNode
.
MoveToNext
())
79
{
80
_level
--;
81
if
(
_level
== 0)
82
{
83
return
false
;
84
}
85
bool
flag =
currentNode
.
MoveToParent
();
86
}
87
return
true
;
88
}
89
90
public
override
XPathNodeIterator
Clone
()
91
{
92
return
new
DescendantOverDescendantQuery
(
this
);
93
}
94
}
MS.Internal.Xml.XPath.BaseAxisQuery.position
int position
Definition
BaseAxisQuery.cs:22
MS.Internal.Xml.XPath.BaseAxisQuery.matches
virtual bool matches(XPathNavigator e)
Definition
BaseAxisQuery.cs:102
MS.Internal.Xml.XPath.BaseAxisQuery.qyInput
Query qyInput
Definition
BaseAxisQuery.cs:8
MS.Internal.Xml.XPath.BaseAxisQuery.currentNode
XPathNavigator currentNode
Definition
BaseAxisQuery.cs:20
MS.Internal.Xml.XPath.DescendantBaseQuery.matchSelf
bool matchSelf
Definition
DescendantBaseQuery.cs:8
MS.Internal.Xml.XPath.DescendantBaseQuery.abbrAxis
bool abbrAxis
Definition
DescendantBaseQuery.cs:10
MS.Internal.Xml.XPath.DescendantBaseQuery
Definition
DescendantBaseQuery.cs:7
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.DescendantOverDescendantQuery
DescendantOverDescendantQuery(DescendantOverDescendantQuery other)
Definition
DescendantOverDescendantQuery.cs:14
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.DescendantOverDescendantQuery
DescendantOverDescendantQuery(Query qyParent, bool matchSelf, string name, string prefix, XPathNodeType typeTest, bool abbrAxis)
Definition
DescendantOverDescendantQuery.cs:9
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.MoveUpUntilNext
bool MoveUpUntilNext()
Definition
DescendantOverDescendantQuery.cs:76
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.MoveToFirstChild
bool MoveToFirstChild()
Definition
DescendantOverDescendantQuery.cs:66
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.Advance
override XPathNavigator Advance()
Definition
DescendantOverDescendantQuery.cs:26
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.Clone
override XPathNodeIterator Clone()
Definition
DescendantOverDescendantQuery.cs:90
MS.Internal.Xml.XPath.DescendantOverDescendantQuery._level
int _level
Definition
DescendantOverDescendantQuery.cs:7
MS.Internal.Xml.XPath.DescendantOverDescendantQuery.Reset
override void Reset()
Definition
DescendantOverDescendantQuery.cs:20
MS.Internal.Xml.XPath.DescendantOverDescendantQuery
Definition
DescendantOverDescendantQuery.cs:6
MS.Internal.Xml.XPath.Query.Advance
XPathNavigator Advance()
MS.Internal.Xml.XPath.Query
Definition
Query.cs:13
System.Xml.XPath.XPathNavigator.MoveToFirstChild
bool MoveToFirstChild()
System.Xml.XPath.XPathNavigator.MoveToParent
bool MoveToParent()
System.Xml.XPath.XPathNavigator.MoveToNext
bool MoveToNext()
System.Xml.XPath.XPathNavigator.Clone
object ICloneable. Clone()
Definition
XPathNavigator.cs:705
System.Xml.XPath.XPathNavigator
Definition
XPathNavigator.cs:15
System.Xml.XPath.XPathNodeIterator
Definition
XPathNodeIterator.cs:8
MS.Internal.Xml.XPath
Definition
AbsoluteQuery.cs:3
System.Xml.XPath.XPathNodeType
XPathNodeType
Definition
XPathNodeType.cs:4
System.Xml.XPath
Definition
Extensions.cs:5
source
System.Private.Xml
MS.Internal.Xml.XPath
DescendantOverDescendantQuery.cs
Generated by
1.10.0