Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DescendantBaseQuery.cs
Go to the documentation of this file.
1using System;
3
5
6internal abstract class DescendantBaseQuery : BaseAxisQuery
7{
8 protected bool matchSelf;
9
10 protected bool abbrAxis;
11
12 public DescendantBaseQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis)
13 : base(qyParent, Name, Prefix, Type)
14 {
15 this.matchSelf = matchSelf;
16 this.abbrAxis = abbrAxis;
17 }
18
20 : base(other)
21 {
22 matchSelf = other.matchSelf;
23 abbrAxis = other.abbrAxis;
24 }
25
26 public override XPathNavigator MatchNode(XPathNavigator context)
27 {
28 if (context != null)
29 {
30 if (!abbrAxis)
31 {
33 }
34 XPathNavigator xPathNavigator = null;
35 if (matches(context))
36 {
37 if (matchSelf && (xPathNavigator = qyInput.MatchNode(context)) != null)
38 {
39 return xPathNavigator;
40 }
41 XPathNavigator xPathNavigator2 = context.Clone();
42 while (xPathNavigator2.MoveToParent())
43 {
44 if ((xPathNavigator = qyInput.MatchNode(xPathNavigator2)) != null)
45 {
46 return xPathNavigator;
47 }
48 }
49 }
50 }
51 return null;
52 }
53}
virtual bool matches(XPathNavigator e)
override XPathNavigator MatchNode(XPathNavigator context)
DescendantBaseQuery(Query qyParent, string Name, string Prefix, XPathNodeType Type, bool matchSelf, bool abbrAxis)
virtual XPathNavigator MatchNode(XPathNavigator current)
Definition Query.cs:60
static string Xp_InvalidPattern
Definition SR.cs:1248
Definition SR.cs:7
static XPathException Create(string res)