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

◆ ConvertFromBigInteger()

static object System.Data.Common.BigIntegerStorage.ConvertFromBigInteger ( BigInteger value,
Type type,
IFormatProvider formatProvider )
inlinestaticpackage

Definition at line 100 of file BigIntegerStorage.cs.

101 {
102 if (type == typeof(string))
103 {
104 return value.ToString("D", formatProvider);
105 }
106 if (type == typeof(sbyte))
107 {
108 return (sbyte)value;
109 }
110 if (type == typeof(short))
111 {
112 return (short)value;
113 }
114 if (type == typeof(int))
115 {
116 return (int)value;
117 }
118 if (type == typeof(long))
119 {
120 return (long)value;
121 }
122 if (type == typeof(byte))
123 {
124 return (byte)value;
125 }
126 if (type == typeof(ushort))
127 {
128 return (ushort)value;
129 }
130 if (type == typeof(uint))
131 {
132 return (uint)value;
133 }
134 if (type == typeof(ulong))
135 {
136 return (ulong)value;
137 }
138 if (type == typeof(float))
139 {
140 return (float)value;
141 }
142 if (type == typeof(double))
143 {
144 return (double)value;
145 }
146 if (type == typeof(decimal))
147 {
148 return (decimal)value;
149 }
150 if (type == typeof(BigInteger))
151 {
152 return value;
153 }
154 throw ExceptionBuilder.ConvertFailed(typeof(BigInteger), type);
155 }

References System.Data.ExceptionBuilder.ConvertFailed(), System.type, and System.value.

Referenced by System.Data.XmlTreeGen.AddExtendedProperties(), and System.Data.Common.SqlConvert.ChangeTypeForDefaultValue().