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

◆ ReadNumericalPrimitiveExtensionDataValue()

IDataNode System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadNumericalPrimitiveExtensionDataValue ( XmlReaderDelegator xmlReader)
inlineprivate

Definition at line 103 of file XmlObjectSerializerReadContextComplexJson.cs.

104 {
105 TypeCode objectTypeCode;
106 object obj = JsonObjectDataContract.ParseJsonNumber(xmlReader.ReadContentAsString(), out objectTypeCode);
107 return objectTypeCode switch
108 {
109 TypeCode.Byte => new DataNode<byte>((byte)obj),
110 TypeCode.SByte => new DataNode<sbyte>((sbyte)obj),
111 TypeCode.Int16 => new DataNode<short>((short)obj),
112 TypeCode.Int32 => new DataNode<int>((int)obj),
113 TypeCode.Int64 => new DataNode<long>((long)obj),
114 TypeCode.UInt16 => new DataNode<ushort>((ushort)obj),
115 TypeCode.UInt32 => new DataNode<uint>((uint)obj),
116 TypeCode.UInt64 => new DataNode<ulong>((ulong)obj),
117 TypeCode.Single => new DataNode<float>((float)obj),
118 TypeCode.Double => new DataNode<double>((double)obj),
119 TypeCode.Decimal => new DataNode<decimal>((decimal)obj),
121 };
122 }
static string ParseJsonNumberReturnInvalidNumber
Definition SR.cs:678
Definition SR.cs:7

References System.Runtime.Serialization.Dictionary, System.obj, System.Runtime.Serialization.Json.JsonObjectDataContract.ParseJsonNumber(), and System.SR.ParseJsonNumberReturnInvalidNumber.

Referenced by System.Runtime.Serialization.Json.XmlObjectSerializerReadContextComplexJson.ReadPrimitiveExtensionDataValue().