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

◆ ReadExtensionData()

IDataNode System.Runtime.Serialization.XmlReaderDelegator.ReadExtensionData ( Type valueType)
inlinepackageinherited

Definition at line 446 of file XmlReaderDelegator.cs.

447 {
448 switch (Type.GetTypeCode(valueType))
449 {
450 case TypeCode.Boolean:
452 case TypeCode.Char:
453 return new DataNode<char>(ReadContentAsChar());
454 case TypeCode.Byte:
456 case TypeCode.Int16:
458 case TypeCode.Int32:
459 return new DataNode<int>(ReadContentAsInt());
460 case TypeCode.Int64:
461 return new DataNode<long>(ReadContentAsLong());
462 case TypeCode.Single:
464 case TypeCode.Double:
466 case TypeCode.Decimal:
468 case TypeCode.DateTime:
470 case TypeCode.String:
472 case TypeCode.SByte:
474 case TypeCode.UInt16:
476 case TypeCode.UInt32:
478 case TypeCode.UInt64:
480 default:
481 if (valueType == Globals.TypeOfByteArray)
482 {
484 }
485 if (valueType == Globals.TypeOfObject)
486 {
487 return new DataNode<object>(new object());
488 }
489 if (valueType == Globals.TypeOfTimeSpan)
490 {
492 }
493 if (valueType == Globals.TypeOfGuid)
494 {
495 return new DataNode<Guid>(ReadContentAsGuid());
496 }
497 if (valueType == Globals.TypeOfUri)
498 {
499 return new DataNode<Uri>(ReadContentAsUri());
500 }
501 if (valueType == Globals.TypeOfXmlQualifiedName)
502 {
504 }
505 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateInvalidPrimitiveTypeException(valueType));
506 }
507 }

References System.Runtime.Serialization.XmlReaderDelegator.CreateInvalidPrimitiveTypeException(), System.Runtime.Serialization.Dictionary, System.Type.GetTypeCode(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsBase64(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsBoolean(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsChar(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsDateTime(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsDecimal(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsDouble(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsGuid(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsInt(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsLong(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsQName(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsShort(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsSignedByte(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsSingle(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsString(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsTimeSpan(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsUnsignedByte(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsUnsignedInt(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsUnsignedLong(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsUnsignedShort(), System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsUri(), System.Runtime.Serialization.DiagnosticUtility.ExceptionUtility.ThrowHelperError(), System.Runtime.Serialization.Globals.TypeOfByteArray, System.Runtime.Serialization.Globals.TypeOfGuid, System.Runtime.Serialization.Globals.TypeOfObject, System.Runtime.Serialization.Globals.TypeOfTimeSpan, System.Runtime.Serialization.Globals.TypeOfUri, and System.Runtime.Serialization.Globals.TypeOfXmlQualifiedName.