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

◆ Evaluate()

override object MS.Internal.Xml.XPath.NodeFunctions.Evaluate ( XPathNodeIterator context)
inline

Definition at line 41 of file NodeFunctions.cs.

42 {
43 switch (_funcType)
44 {
45 case Function.FunctionType.FuncPosition:
46 return (double)context.CurrentPosition;
47 case Function.FunctionType.FuncLast:
48 return (double)context.Count;
49 case Function.FunctionType.FuncNameSpaceUri:
50 {
51 XPathNavigator xPathNavigator2 = EvaluateArg(context);
52 if (xPathNavigator2 != null)
53 {
54 return xPathNavigator2.NamespaceURI;
55 }
56 break;
57 }
58 case Function.FunctionType.FuncLocalName:
59 {
60 XPathNavigator xPathNavigator2 = EvaluateArg(context);
61 if (xPathNavigator2 != null)
62 {
63 return xPathNavigator2.LocalName;
64 }
65 break;
66 }
67 case Function.FunctionType.FuncName:
68 {
69 XPathNavigator xPathNavigator2 = EvaluateArg(context);
70 if (xPathNavigator2 != null)
71 {
72 return xPathNavigator2.Name;
73 }
74 break;
75 }
76 case Function.FunctionType.FuncCount:
77 {
78 _arg.Evaluate(context);
79 int num = 0;
80 if (_xsltContext != null)
81 {
82 XPathNavigator xPathNavigator;
83 while ((xPathNavigator = _arg.Advance()) != null)
84 {
85 if (xPathNavigator.NodeType != XPathNodeType.Whitespace || _xsltContext.PreserveWhitespace(xPathNavigator))
86 {
87 num++;
88 }
89 }
90 }
91 else
92 {
93 while (_arg.Advance() != null)
94 {
95 num++;
96 }
97 }
98 return (double)num;
99 }
100 }
101 return string.Empty;
102 }
XPathNavigator EvaluateArg(XPathNodeIterator context)
readonly Function.FunctionType _funcType
object Evaluate(XPathNodeIterator nodeIterator)
XPathNavigator Advance()
bool PreserveWhitespace(XPathNavigator node)

References MS.Internal.Xml.XPath.NodeFunctions._arg, MS.Internal.Xml.XPath.NodeFunctions._funcType, MS.Internal.Xml.XPath.NodeFunctions._xsltContext, MS.Internal.Xml.XPath.Query.Advance(), System.Xml.XPath.XPathNodeIterator.Count, System.Xml.XPath.XPathNodeIterator.CurrentPosition, MS.Internal.Xml.XPath.Query.Evaluate(), MS.Internal.Xml.XPath.NodeFunctions.EvaluateArg(), System.Xml.XPath.XPathNavigator.LocalName, System.Xml.XPath.XPathNavigator.Name, System.Xml.XPath.XPathNavigator.NamespaceURI, System.Xml.XPath.XPathNavigator.NodeType, and System.Xml.Xsl.XsltContext.PreserveWhitespace().