Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ ValidateElement()

override object System.Xml.Schema.RangeContentValidator.ValidateElement ( XmlQualifiedName name,
ValidationState context,
out int errorCode )
inlinevirtual

Reimplemented from System.Xml.Schema.ContentValidator.

Definition at line 53 of file RangeContentValidator.cs.

54 {
55 errorCode = 0;
56 int num = _symbols[name];
57 bool flag = false;
58 List<RangePositionInfo> runningPositions = context.RunningPositions;
59 int numberOfRunningPos = context.CurrentState.NumberOfRunningPos;
60 int i = 0;
61 int num2 = -1;
62 int num3 = -1;
63 bool flag2 = false;
64 for (; i < numberOfRunningPos; i++)
65 {
66 BitSet curpos = runningPositions[i].curpos;
67 for (int num4 = curpos.NextSet(-1); num4 != -1; num4 = curpos.NextSet(num4))
68 {
69 if (num == _positions[num4].symbol)
70 {
71 num2 = num4;
72 if (num3 == -1)
73 {
74 num3 = i;
75 }
76 flag2 = true;
77 break;
78 }
79 }
80 if (flag2 && _positions[num2].particle is XmlSchemaElement)
81 {
82 break;
83 }
84 }
85 if (i == numberOfRunningPos && num2 != -1)
86 {
87 i = num3;
88 }
89 if (i < numberOfRunningPos)
90 {
91 if (i != 0)
92 {
93 runningPositions.RemoveRange(0, i);
94 }
96 i = 0;
97 while (i < numberOfRunningPos)
98 {
99 RangePositionInfo value = runningPositions[i];
100 if (value.curpos.Get(num2))
101 {
104 i++;
105 continue;
106 }
108 if (numberOfRunningPos > 0)
109 {
110 RangePositionInfo value2 = runningPositions[numberOfRunningPos];
113 }
114 }
115 }
116 else
117 {
119 }
120 if (numberOfRunningPos > 0)
121 {
122 if (numberOfRunningPos >= 10000)
123 {
124 context.TooComplex = true;
126 }
127 for (i = numberOfRunningPos - 1; i >= 0; i--)
128 {
129 int index = i;
130 BitSet curpos2 = runningPositions[i].curpos;
131 flag = flag || curpos2.Get(_endMarkerPos);
132 while (numberOfRunningPos < 10000 && curpos2.Intersects(_positionsWithRangeTerminals))
133 {
134 BitSet bitSet = curpos2.Clone();
136 int num5 = bitSet.NextSet(-1);
137 LeafRangeNode leafRangeNode = _positions[num5].particle as LeafRangeNode;
138 RangePositionInfo value = runningPositions[index];
140 {
141 runningPositions.Add(default(RangePositionInfo));
142 runningPositions.Add(default(RangePositionInfo));
143 }
144 RangePositionInfo value3 = runningPositions[numberOfRunningPos];
145 if (value3.rangeCounters == null)
146 {
148 }
149 Array.Copy(value.rangeCounters, value3.rangeCounters, value.rangeCounters.Length);
150 decimal num6 = ++value3.rangeCounters[leafRangeNode.Pos];
151 if (num6 == leafRangeNode.Max)
152 {
154 value3.rangeCounters[leafRangeNode.Pos] = default(decimal);
157 }
158 else
159 {
160 if (num6 < leafRangeNode.Min)
161 {
162 value3.curpos = leafRangeNode.NextIteration;
165 break;
166 }
167 value3.curpos = leafRangeNode.NextIteration;
171 if (value3.rangeCounters == null)
172 {
174 }
175 Array.Copy(value.rangeCounters, value3.rangeCounters, value.rangeCounters.Length);
177 value3.rangeCounters[leafRangeNode.Pos] = default(decimal);
180 }
182 flag = flag || curpos2.Get(_endMarkerPos);
183 }
184 }
185 context.HasMatched = flag;
187 return _positions[num2].particle;
188 }
189 errorCode = -1;
191 return null;
192 }
void Add(TKey key, TValue value)

References System.Xml.Schema.RangeContentValidator._endMarkerPos, System.Xml.Schema.RangeContentValidator._followpos, System.Xml.Schema.RangeContentValidator._minMaxNodesCount, System.Xml.Schema.RangeContentValidator._positions, System.Xml.Schema.RangeContentValidator._positionsWithRangeTerminals, System.Xml.Schema.RangeContentValidator._symbols, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.Array.Copy(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Schema.ValidationState.CurrentState, System.Xml.Dictionary, System.index, System.Xml.Schema.BitSet.NextSet(), System.Xml.Schema.StateUnion.NumberOfRunningPos, System.Xml.Schema.ValidationState.RunningPositions, and System.value.