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

◆ ReadContentAsAnyType()

object System.Runtime.Serialization.XmlReaderDelegator.ReadContentAsAnyType ( Type valueType)
inlinepackageinherited

Definition at line 383 of file XmlReaderDelegator.cs.

384 {
385 switch (Type.GetTypeCode(valueType))
386 {
387 case TypeCode.Boolean:
388 return ReadContentAsBoolean();
389 case TypeCode.Char:
390 return ReadContentAsChar();
391 case TypeCode.Byte:
393 case TypeCode.Int16:
394 return ReadContentAsShort();
395 case TypeCode.Int32:
396 return ReadContentAsInt();
397 case TypeCode.Int64:
398 return ReadContentAsLong();
399 case TypeCode.Single:
400 return ReadContentAsSingle();
401 case TypeCode.Double:
402 return ReadContentAsDouble();
403 case TypeCode.Decimal:
404 return ReadContentAsDecimal();
405 case TypeCode.DateTime:
406 return ReadContentAsDateTime();
407 case TypeCode.String:
408 return ReadContentAsString();
409 case TypeCode.SByte:
411 case TypeCode.UInt16:
413 case TypeCode.UInt32:
415 case TypeCode.UInt64:
417 default:
418 if (valueType == Globals.TypeOfByteArray)
419 {
420 return ReadContentAsBase64();
421 }
422 if (valueType == Globals.TypeOfObject)
423 {
424 return new object();
425 }
426 if (valueType == Globals.TypeOfTimeSpan)
427 {
428 return ReadContentAsTimeSpan();
429 }
430 if (valueType == Globals.TypeOfGuid)
431 {
432 return ReadContentAsGuid();
433 }
434 if (valueType == Globals.TypeOfUri)
435 {
436 return ReadContentAsUri();
437 }
438 if (valueType == Globals.TypeOfXmlQualifiedName)
439 {
440 return ReadContentAsQName();
441 }
442 throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(CreateInvalidPrimitiveTypeException(valueType));
443 }
444 }

References System.Runtime.Serialization.XmlReaderDelegator.CreateInvalidPrimitiveTypeException(), 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.

Referenced by System.Runtime.Serialization.XmlReaderDelegator.ReadElementContentAsAnyType().