Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ numberAny()

int System.Xml.Xsl.XsltOld.NumberAction.numberAny ( Processor processor,
ActionFrame frame )
inlineprivate

Definition at line 243 of file NumberAction.cs.

244 {
245 int num = 0;
246 XPathNavigator xPathNavigator = frame.Node;
247 if (xPathNavigator.NodeType == XPathNodeType.Attribute || xPathNavigator.NodeType == XPathNodeType.Namespace)
248 {
250 xPathNavigator.MoveToParent();
251 }
253 if (_fromKey != -1)
254 {
255 bool flag = false;
256 do
257 {
258 if (processor.Matches(xPathNavigator2, _fromKey))
259 {
260 flag = true;
261 break;
262 }
263 }
264 while (xPathNavigator2.MoveToParent());
265 XPathNodeIterator xPathNodeIterator = xPathNavigator2.SelectDescendants(XPathNodeType.All, matchSelf: true);
266 while (xPathNodeIterator.MoveNext())
267 {
268 if (processor.Matches(xPathNodeIterator.Current, _fromKey))
269 {
270 flag = true;
271 num = 0;
272 }
273 else if (MatchCountKey(processor, frame.Node, xPathNodeIterator.Current))
274 {
275 num++;
276 }
277 if (xPathNodeIterator.Current.IsSamePosition(xPathNavigator))
278 {
279 break;
280 }
281 }
282 if (!flag)
283 {
284 num = 0;
285 }
286 }
287 else
288 {
289 xPathNavigator2.MoveToRoot();
290 XPathNodeIterator xPathNodeIterator2 = xPathNavigator2.SelectDescendants(XPathNodeType.All, matchSelf: true);
291 while (xPathNodeIterator2.MoveNext())
292 {
293 if (MatchCountKey(processor, frame.Node, xPathNodeIterator2.Current))
294 {
295 num++;
296 }
297 if (xPathNodeIterator2.Current.IsSamePosition(xPathNavigator))
298 {
299 break;
300 }
301 }
302 }
303 return num;
304 }
bool MatchCountKey(Processor processor, XPathNavigator contextNode, XPathNavigator nav)

References System.Xml.Xsl.XsltOld.NumberAction._fromKey, System.Xml.Xsl.XsltOld.NumberAction.MatchCountKey(), and System.Xml.Xsl.XsltOld.ActionFrame.Node.

Referenced by System.Xml.Xsl.XsltOld.NumberAction.Execute().