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

◆ ChangeType() [8/9]

override object System.Xml.Schema.XmlNumeric10Converter.ChangeType ( object value,
Type destinationType,
IXmlNamespaceResolver nsResolver )
inline

Definition at line 355 of file XmlNumeric10Converter.cs.

356 {
357 if (value == null)
358 {
359 throw new ArgumentNullException("value");
360 }
361 if (destinationType == null)
362 {
363 throw new ArgumentNullException("destinationType");
364 }
365 Type type = value.GetType();
366 if (destinationType == XmlBaseConverter.ObjectType)
367 {
368 destinationType = base.DefaultClrType;
369 }
370 if (destinationType == XmlBaseConverter.DecimalType)
371 {
372 return ToDecimal(value);
373 }
374 if (destinationType == XmlBaseConverter.Int32Type)
375 {
376 return ToInt32(value);
377 }
378 if (destinationType == XmlBaseConverter.Int64Type)
379 {
380 return ToInt64(value);
381 }
382 if (destinationType == XmlBaseConverter.StringType)
383 {
384 return ToString(value, nsResolver);
385 }
386 if (destinationType == XmlBaseConverter.XmlAtomicValueType)
387 {
388 if (type == XmlBaseConverter.DecimalType)
389 {
390 return new XmlAtomicValue(base.SchemaType, value);
391 }
392 if (type == XmlBaseConverter.Int32Type)
393 {
394 return new XmlAtomicValue(base.SchemaType, (int)value);
395 }
396 if (type == XmlBaseConverter.Int64Type)
397 {
398 return new XmlAtomicValue(base.SchemaType, (long)value);
399 }
400 if (type == XmlBaseConverter.StringType)
401 {
402 return new XmlAtomicValue(base.SchemaType, (string)value);
403 }
404 if (type == XmlBaseConverter.XmlAtomicValueType)
405 {
406 return (XmlAtomicValue)value;
407 }
408 }
409 if (destinationType == XmlBaseConverter.XPathItemType)
410 {
411 if (type == XmlBaseConverter.DecimalType)
412 {
413 return new XmlAtomicValue(base.SchemaType, value);
414 }
415 if (type == XmlBaseConverter.Int32Type)
416 {
417 return new XmlAtomicValue(base.SchemaType, (int)value);
418 }
419 if (type == XmlBaseConverter.Int64Type)
420 {
421 return new XmlAtomicValue(base.SchemaType, (long)value);
422 }
423 if (type == XmlBaseConverter.StringType)
424 {
425 return new XmlAtomicValue(base.SchemaType, (string)value);
426 }
427 if (type == XmlBaseConverter.XmlAtomicValueType)
428 {
429 return (XmlAtomicValue)value;
430 }
431 }
432 if (destinationType == XmlBaseConverter.ByteType)
433 {
434 return XmlBaseConverter.Int32ToByte(ToInt32(value));
435 }
436 if (destinationType == XmlBaseConverter.Int16Type)
437 {
438 return XmlBaseConverter.Int32ToInt16(ToInt32(value));
439 }
440 if (destinationType == XmlBaseConverter.SByteType)
441 {
442 return XmlBaseConverter.Int32ToSByte(ToInt32(value));
443 }
444 if (destinationType == XmlBaseConverter.UInt16Type)
445 {
446 return XmlBaseConverter.Int32ToUInt16(ToInt32(value));
447 }
448 if (destinationType == XmlBaseConverter.UInt32Type)
449 {
450 return XmlBaseConverter.Int64ToUInt32(ToInt64(value));
451 }
452 if (destinationType == XmlBaseConverter.UInt64Type)
453 {
454 return XmlBaseConverter.DecimalToUInt64(ToDecimal(value));
455 }
456 if (type == XmlBaseConverter.ByteType)
457 {
458 return ChangeType((byte)value, destinationType);
459 }
460 if (type == XmlBaseConverter.Int16Type)
461 {
462 return ChangeType((short)value, destinationType);
463 }
464 if (type == XmlBaseConverter.SByteType)
465 {
466 return ChangeType((sbyte)value, destinationType);
467 }
468 if (type == XmlBaseConverter.UInt16Type)
469 {
470 return ChangeType((ushort)value, destinationType);
471 }
472 if (type == XmlBaseConverter.UInt32Type)
473 {
474 return ChangeType((uint)value, destinationType);
475 }
476 if (type == XmlBaseConverter.UInt64Type)
477 {
478 return ChangeType((decimal)(ulong)value, destinationType);
479 }
481 }
virtual object ChangeListType(object value, Type destinationType, IXmlNamespaceResolver nsResolver)
XmlBaseConverter(XmlSchemaType schemaType)
override object ChangeType(decimal value, Type destinationType)
override decimal ToDecimal(string value)

References System.Xml.Schema.XmlBaseConverter.ByteType, System.Xml.Schema.XmlBaseConverter.ChangeListType(), System.Xml.Schema.XmlNumeric10Converter.ChangeType(), System.Xml.Schema.XmlBaseConverter.DecimalToUInt64(), System.Xml.Schema.XmlBaseConverter.DecimalType, System.Xml.Dictionary, System.Type.GetType(), System.Xml.Schema.XmlBaseConverter.Int16Type, System.Xml.Schema.XmlBaseConverter.Int32ToByte(), System.Xml.Schema.XmlBaseConverter.Int32ToInt16(), System.Xml.Schema.XmlBaseConverter.Int32ToSByte(), System.Xml.Schema.XmlBaseConverter.Int32ToUInt16(), System.Xml.Schema.XmlBaseConverter.Int32Type, System.Xml.Schema.XmlBaseConverter.Int64ToUInt32(), System.Xml.Schema.XmlBaseConverter.Int64Type, System.Xml.Schema.XmlBaseConverter.ObjectType, System.Xml.Schema.XmlBaseConverter.SByteType, System.Xml.Schema.XmlBaseConverter.StringType, System.Xml.Schema.XmlNumeric10Converter.ToDecimal(), System.Xml.Schema.XmlNumeric10Converter.ToInt32(), System.Xml.Schema.XmlNumeric10Converter.ToInt64(), System.ToString, System.type, System.Xml.Schema.XmlBaseConverter.UInt16Type, System.Xml.Schema.XmlBaseConverter.UInt32Type, System.Xml.Schema.XmlBaseConverter.UInt64Type, System.value, System.Xml.Schema.XmlBaseConverter.XmlAtomicValueType, and System.Xml.Schema.XmlBaseConverter.XPathItemType.