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

◆ ChangeTypeXsltArgument() [2/2]

object System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument ( XmlQueryType xmlType,
object value,
Type destinationType )
inlinepackage

Definition at line 318 of file XmlQueryRuntime.cs.

319 {
320 switch (xmlType.TypeCode)
321 {
322 case XmlTypeCode.String:
323 if (destinationType == XsltConvert.DateTimeType)
324 {
325 value = XsltConvert.ToDateTime((string)value);
326 }
327 break;
328 case XmlTypeCode.Double:
329 if (destinationType != XsltConvert.DoubleType)
330 {
332 }
333 break;
334 case XmlTypeCode.Node:
335 if (destinationType == XsltConvert.XPathNodeIteratorType)
336 {
338 }
339 else if (destinationType == XsltConvert.XPathNavigatorArrayType)
340 {
343 for (int i = 0; i < list2.Count; i++)
344 {
345 array[i] = list2[i];
346 }
347 value = array;
348 }
349 break;
350 case XmlTypeCode.Item:
351 {
352 if (destinationType != XsltConvert.ObjectType)
353 {
354 throw new XslTransformException(System.SR.Xslt_UnsupportedClrType, destinationType.Name);
355 }
357 if (list.Count == 1)
358 {
360 value = ((!xPathItem.IsNode) ? xPathItem.TypedValue : ((!(xPathItem is RtfNavigator rtfNavigator)) ? ((ICloneable)new XPathArrayIterator((IList)value)) : ((ICloneable)rtfNavigator.ToNavigator())));
361 }
362 else
363 {
365 }
366 break;
367 }
368 }
369 return value;
370 }
static CultureInfo InvariantCulture
static string Xslt_UnsupportedClrType
Definition SR.cs:1992
Definition SR.cs:7

References System.array, System.Convert.ChangeType(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Xml.Xsl.Runtime.XsltConvert.DateTimeType, System.Xml.Dictionary, System.Xml.Xsl.Runtime.XsltConvert.DoubleType, System.Globalization.CultureInfo.InvariantCulture, System.list, System.Xml.Xsl.Runtime.XsltConvert.ObjectType, System.Xml.Xsl.Runtime.XsltConvert.ToDateTime(), System.Xml.Xsl.XmlQueryType.TypeCode, System.value, System.Xml.Xsl.Runtime.XsltConvert.XPathNavigatorArrayType, System.Xml.Xsl.Runtime.XsltConvert.XPathNodeIteratorType, and System.SR.Xslt_UnsupportedClrType.