Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
XmlQueryNodeSequence.cs
Go to the documentation of this file.
5
7
9public sealed class XmlQueryNodeSequence : XmlQuerySequence<XPathNavigator>, IList<XPathItem>, ICollection<XPathItem>, IEnumerable<XPathItem>, IEnumerable
10{
11 public new static readonly XmlQueryNodeSequence Empty = new XmlQueryNodeSequence();
12
14
16 {
17 get
18 {
19 if (_docOrderDistinct != this)
20 {
21 return base.Count <= 1;
22 }
23 return true;
24 }
25 set
26 {
27 _docOrderDistinct = (value ? this : null);
28 }
29 }
30
32
34 {
35 get
36 {
37 if (index >= base.Count)
38 {
39 throw new ArgumentOutOfRangeException("index");
40 }
41 return base[index];
42 }
43 set
44 {
45 throw new NotSupportedException();
46 }
47 }
48
50 {
51 if (seq != null)
52 {
53 seq.Clear();
54 return seq;
55 }
56 return new XmlQueryNodeSequence();
57 }
58
60 {
61 if (seq != null)
62 {
63 seq.Clear();
65 return seq;
66 }
68 }
69
71 {
72 }
73
75 : base(capacity)
76 {
77 }
78
80 : base(list.Count)
81 {
82 for (int i = 0; i < list.Count; i++)
83 {
84 AddClone(list[i]);
85 }
86 }
87
89 : base(array, size)
90 {
91 }
92
98
100 {
101 if (_docOrderDistinct != null)
102 {
103 return _docOrderDistinct;
104 }
105 if (base.Count <= 1)
106 {
107 return this;
108 }
110 for (int i = 0; i < array.Length; i++)
111 {
112 array[i] = base[i];
113 }
115 int num = 0;
116 for (int i = 1; i < array.Length; i++)
117 {
118 if (!array[num].IsSamePosition(array[i]))
119 {
120 num++;
121 if (num != i)
122 {
123 array[num] = array[i];
124 }
125 }
126 }
129 return _docOrderDistinct;
130 }
131
133 {
134 Add(navigator.Clone());
135 }
136
137 protected override void OnItemsChanged()
138 {
139 _docOrderDistinct = null;
140 }
141
146
151
153 {
154 throw new NotSupportedException();
155 }
156
161
163 {
164 for (int i = 0; i < base.Count; i++)
165 {
166 array[index + i] = base[i];
167 }
168 }
169
174
176 {
178 }
179
181 {
182 throw new NotSupportedException();
183 }
184
185 void IList<XPathItem>.RemoveAt(int index)
186 {
187 throw new NotSupportedException();
188 }
189}
static void Sort(Array array)
Definition Array.cs:2329
bool ICollection< KeyValuePair< TKey, TValue > >. Remove(KeyValuePair< TKey, TValue > keyValuePair)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
bool ICollection< KeyValuePair< TKey, TValue > >. Contains(KeyValuePair< TKey, TValue > keyValuePair)
bool ICollection< KeyValuePair< TKey, TValue > >. IsReadOnly
void Add(TKey key, TValue value)
int IList< XPathItem >. IndexOf(XPathItem value)
static XmlQueryNodeSequence CreateOrReuse(XmlQueryNodeSequence seq, XPathNavigator navigator)
static XmlQueryNodeSequence CreateOrReuse(XmlQueryNodeSequence seq)
XmlQueryNodeSequence(XPathNavigator[] array, int size)
XmlQueryNodeSequence DocOrderDistinct(IComparer< XPathNavigator > comparer)
XmlQueryNodeSequence(IList< XPathNavigator > list)