Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XPathAxisIterator.cs
Go to the documentation of this file.
1using System;
3
5
6internal abstract class XPathAxisIterator : XPathNodeIterator
7{
9
11
12 internal string name;
13
14 internal string uri;
15
16 internal int position;
17
18 internal bool matchSelf;
19
20 internal bool first = true;
21
22 public override XPathNavigator Current => nav;
23
24 public override int CurrentPosition => position;
25
26 protected virtual bool Matches
27 {
28 get
29 {
30 if (name == null)
31 {
32 if (type != nav.NodeType && type != XPathNodeType.All)
33 {
34 if (type == XPathNodeType.Text)
35 {
36 if (nav.NodeType != XPathNodeType.Whitespace)
37 {
38 return nav.NodeType == XPathNodeType.SignificantWhitespace;
39 }
40 return true;
41 }
42 return false;
43 }
44 return true;
45 }
46 if (nav.NodeType == XPathNodeType.Element && (name.Length == 0 || name == nav.LocalName))
47 {
48 return uri == nav.NamespaceURI;
49 }
50 return false;
51 }
52 }
53
55 {
56 this.nav = nav;
57 this.matchSelf = matchSelf;
58 }
59
61 : this(nav, matchSelf)
62 {
63 this.type = type;
64 }
65
66 public XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf)
67 : this(nav, matchSelf)
68 {
69 if (name == null)
70 {
71 throw new ArgumentNullException("name");
72 }
73 if (namespaceURI == null)
74 {
75 throw new ArgumentNullException("namespaceURI");
76 }
77 this.name = name;
78 uri = namespaceURI;
79 }
80
82 {
83 nav = it.nav.Clone();
84 type = it.type;
85 name = it.name;
86 uri = it.uri;
87 position = it.position;
89 first = it.first;
90 }
91}
XPathAxisIterator(XPathNavigator nav, XPathNodeType type, bool matchSelf)
XPathAxisIterator(XPathNavigator nav, string name, string namespaceURI, bool matchSelf)
XPathAxisIterator(XPathNavigator nav, bool matchSelf)