Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
AttributeQuery.cs
Go to the documentation of this file.
2
4
5internal sealed class AttributeQuery : BaseAxisQuery
6{
7 private bool _onAttribute;
8
9 public AttributeQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type)
10 : base(qyParent, Name, Prefix, Type)
11 {
12 }
13
15 : base(other)
16 {
17 _onAttribute = other._onAttribute;
18 }
19
20 public override void Reset()
21 {
22 _onAttribute = false;
23 base.Reset();
24 }
25
26 public override XPathNavigator Advance()
27 {
28 do
29 {
30 if (!_onAttribute)
31 {
33 if (currentNode == null)
34 {
35 return null;
36 }
37 position = 0;
40 }
41 else
42 {
44 }
45 }
46 while (!_onAttribute || !matches(currentNode));
47 position++;
48 return currentNode;
49 }
50
51 public override XPathNavigator MatchNode(XPathNavigator context)
52 {
53 if (context != null && context.NodeType == XPathNodeType.Attribute && matches(context))
54 {
55 XPathNavigator xPathNavigator = context.Clone();
56 if (xPathNavigator.MoveToParent())
57 {
58 return qyInput.MatchNode(xPathNavigator);
59 }
60 }
61 return null;
62 }
63
64 public override XPathNodeIterator Clone()
65 {
66 return new AttributeQuery(this);
67 }
68}
override XPathNodeIterator Clone()
override XPathNavigator MatchNode(XPathNavigator context)
override XPathNavigator Advance()
AttributeQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type)
virtual bool matches(XPathNavigator e)
virtual XPathNavigator MatchNode(XPathNavigator current)
Definition Query.cs:60
XPathNavigator Advance()