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

◆ ConvertToNumber()

QilNode System.Xml.Xsl.XPath.XPathQilFactory.ConvertToNumber ( QilNode n)
inlineinherited

Definition at line 176 of file XPathQilFactory.cs.

177 {
178 switch (n.XmlType.TypeCode)
179 {
180 case XmlTypeCode.Boolean:
181 if (n.NodeType != QilNodeType.True)
182 {
183 if (n.NodeType != QilNodeType.False)
184 {
185 return Conditional(n, Double(1.0), Double(0.0));
186 }
187 return Double(0.0);
188 }
189 return Double(1.0);
190 case XmlTypeCode.Double:
191 return n;
192 case XmlTypeCode.String:
193 return XsltConvert(n, XmlQueryTypeFactory.DoubleX);
194 default:
195 if (n.XmlType.IsNode)
196 {
197 return XsltConvert(XPathNodeValue(SafeDocOrderDistinct(n)), XmlQueryTypeFactory.DoubleX);
198 }
199 return XsltConvert(n, XmlQueryTypeFactory.DoubleX);
200 }
201 }

References System.Xml.Xsl.Qil.Conditional, System.Xml.Dictionary, System.Xml.Double, System.Xml.Xsl.XmlQueryTypeFactory.DoubleX, System.Xml.Xsl.XPath.XPathQilFactory.SafeDocOrderDistinct(), System.Xml.Xsl.Qil.XPathNodeValue, and System.Xml.Xsl.Qil.XsltConvert.

Referenced by System.Xml.Xsl.XPath.XPathBuilder.ArithmeticOperator(), System.Xml.Xsl.Xslt.QilGenerator.CompileDataTypeAttribute(), System.Xml.Xsl.Xslt.QilGenerator.CompileGroupingSizeAttribute(), System.Xml.Xsl.Xslt.QilGenerator.CompileNumber(), System.Xml.Xsl.XPath.XPathQilFactory.ConvertToType(), System.Xml.Xsl.XPath.XPathBuilder.Function(), System.Xml.Xsl.Xslt.QilGenerator.GenerateScriptCall(), System.Xml.Xsl.XPath.XPathBuilder.NegateOperator(), and System.Xml.Xsl.XPath.XPathBuilder.Sum().