9 [__DynamicallyInvokable]
12 internal static readonly RuntimeType[] ConvertTypes =
new RuntimeType[19]
14 (RuntimeType)typeof(Empty),
15 (RuntimeType)typeof(
object),
16 (RuntimeType)typeof(
DBNull),
17 (RuntimeType)typeof(
bool),
18 (RuntimeType)typeof(
char),
19 (RuntimeType)typeof(sbyte),
20 (RuntimeType)typeof(
byte),
21 (RuntimeType)typeof(
short),
22 (RuntimeType)typeof(ushort),
23 (RuntimeType)typeof(
int),
24 (RuntimeType)typeof(uint),
25 (RuntimeType)typeof(
long),
26 (RuntimeType)typeof(ulong),
27 (RuntimeType)typeof(
float),
28 (RuntimeType)typeof(
double),
29 (RuntimeType)typeof(decimal),
31 (RuntimeType)typeof(
object),
32 (RuntimeType)typeof(
string)
35 private static readonly RuntimeType EnumType = (RuntimeType)typeof(
Enum);
37 internal static readonly
char[] base64Table =
new char[65]
106 private const int base64LineBreakPosition = 76;
114 [__DynamicallyInvokable]
135 if (convertible ==
null)
174 [__DynamicallyInvokable]
182 if (convertible ==
null)
191 return convertible.
ToChar(provider);
193 return convertible.
ToSByte(provider);
195 return convertible.
ToByte(provider);
197 return convertible.
ToInt16(provider);
199 return convertible.
ToUInt16(provider);
201 return convertible.
ToInt32(provider);
203 return convertible.
ToUInt32(provider);
205 return convertible.
ToInt64(provider);
207 return convertible.
ToUInt64(provider);
209 return convertible.
ToSingle(provider);
211 return convertible.
ToDouble(provider);
217 return convertible.
ToString(provider);
231 if (targetType ==
null)
235 RuntimeType left = targetType as RuntimeType;
238 if (value.GetType() == targetType)
242 if (left == ConvertTypes[3])
244 return value.ToBoolean(provider);
246 if (left == ConvertTypes[4])
248 return value.ToChar(provider);
250 if (left == ConvertTypes[5])
252 return value.ToSByte(provider);
254 if (left == ConvertTypes[6])
256 return value.ToByte(provider);
258 if (left == ConvertTypes[7])
260 return value.ToInt16(provider);
262 if (left == ConvertTypes[8])
264 return value.ToUInt16(provider);
266 if (left == ConvertTypes[9])
268 return value.ToInt32(provider);
270 if (left == ConvertTypes[10])
272 return value.ToUInt32(provider);
274 if (left == ConvertTypes[11])
276 return value.ToInt64(provider);
278 if (left == ConvertTypes[12])
280 return value.ToUInt64(provider);
282 if (left == ConvertTypes[13])
284 return value.ToSingle(provider);
286 if (left == ConvertTypes[14])
288 return value.ToDouble(provider);
290 if (left == ConvertTypes[15])
292 return value.ToDecimal(provider);
294 if (left == ConvertTypes[16])
296 return value.ToDateTime(provider);
298 if (left == ConvertTypes[18])
300 return value.ToString(provider);
302 if (left == ConvertTypes[1])
306 if (left == EnumType)
310 if (left == ConvertTypes[2])
312 throw new InvalidCastException(Environment.GetResourceString(
"InvalidCast_DBNull"));
314 if (left == ConvertTypes[0])
316 throw new InvalidCastException(Environment.GetResourceString(
"InvalidCast_Empty"));
319 throw new InvalidCastException(Environment.GetResourceString(
"InvalidCast_FromTo", value.GetType().FullName, targetType.
FullName));
335 [__DynamicallyInvokable]
356 [__DynamicallyInvokable]
359 if (conversionType ==
null)
372 if (convertible ==
null)
374 if (value.GetType() == conversionType)
380 RuntimeType left = conversionType as RuntimeType;
381 if (left == ConvertTypes[3])
385 if (left == ConvertTypes[4])
387 return convertible.
ToChar(provider);
389 if (left == ConvertTypes[5])
391 return convertible.
ToSByte(provider);
393 if (left == ConvertTypes[6])
395 return convertible.
ToByte(provider);
397 if (left == ConvertTypes[7])
399 return convertible.
ToInt16(provider);
401 if (left == ConvertTypes[8])
403 return convertible.
ToUInt16(provider);
405 if (left == ConvertTypes[9])
407 return convertible.
ToInt32(provider);
409 if (left == ConvertTypes[10])
411 return convertible.
ToUInt32(provider);
413 if (left == ConvertTypes[11])
415 return convertible.
ToInt64(provider);
417 if (left == ConvertTypes[12])
419 return convertible.
ToUInt64(provider);
421 if (left == ConvertTypes[13])
423 return convertible.
ToSingle(provider);
425 if (left == ConvertTypes[14])
427 return convertible.
ToDouble(provider);
429 if (left == ConvertTypes[15])
433 if (left == ConvertTypes[16])
437 if (left == ConvertTypes[18])
439 return convertible.
ToString(provider);
441 if (left == ConvertTypes[1])
445 return convertible.
ToType(conversionType, provider);
456 [__DynamicallyInvokable]
475 [__DynamicallyInvokable]
489 [__DynamicallyInvokable]
499 [CLSCompliant(
false)]
500 [__DynamicallyInvokable]
519 [__DynamicallyInvokable]
529 [__DynamicallyInvokable]
539 [CLSCompliant(
false)]
540 [__DynamicallyInvokable]
550 [__DynamicallyInvokable]
560 [CLSCompliant(
false)]
561 [__DynamicallyInvokable]
571 [__DynamicallyInvokable]
581 [CLSCompliant(
false)]
582 [__DynamicallyInvokable]
594 [__DynamicallyInvokable]
601 return bool.Parse(value);
611 [__DynamicallyInvokable]
618 return bool.Parse(value);
625 [__DynamicallyInvokable]
635 [__DynamicallyInvokable]
645 [__DynamicallyInvokable]
648 return value != decimal.Zero;
669 [__DynamicallyInvokable]
689 [__DynamicallyInvokable]
722 [CLSCompliant(
false)]
723 [__DynamicallyInvokable]
736 [__DynamicallyInvokable]
747 [__DynamicallyInvokable]
760 [CLSCompliant(
false)]
761 [__DynamicallyInvokable]
772 [__DynamicallyInvokable]
775 if (value < 0 || value > 65535)
787 [CLSCompliant(
false)]
788 [__DynamicallyInvokable]
803 [__DynamicallyInvokable]
806 if (value < 0 || value > 65535)
818 [CLSCompliant(
false)]
819 [__DynamicallyInvokable]
835 [__DynamicallyInvokable]
838 return ToChar(value,
null);
848 [__DynamicallyInvokable]
855 if (value.Length != 1)
907 [CLSCompliant(
false)]
908 [__DynamicallyInvokable]
928 [CLSCompliant(
false)]
929 [__DynamicallyInvokable]
942 [CLSCompliant(
false)]
943 [__DynamicallyInvokable]
957 [CLSCompliant(
false)]
958 [__DynamicallyInvokable]
969 [CLSCompliant(
false)]
970 [__DynamicallyInvokable]
973 if (value >
'\u007f')
985 [CLSCompliant(
false)]
986 [__DynamicallyInvokable]
1001 [CLSCompliant(
false)]
1002 [__DynamicallyInvokable]
1005 if (value < -128 || value > 127)
1009 return (sbyte)value;
1017 [CLSCompliant(
false)]
1018 [__DynamicallyInvokable]
1025 return (sbyte)value;
1033 [CLSCompliant(
false)]
1034 [__DynamicallyInvokable]
1037 if (value < -128 || value > 127)
1041 return (sbyte)value;
1049 [CLSCompliant(
false)]
1050 [__DynamicallyInvokable]
1053 if ((
long)value > 127
L)
1057 return (sbyte)value;
1065 [CLSCompliant(
false)]
1066 [__DynamicallyInvokable]
1069 if (value < -128 || value > 127)
1073 return (sbyte)value;
1081 [CLSCompliant(
false)]
1082 [__DynamicallyInvokable]
1089 return (sbyte)value;
1098 [CLSCompliant(
false)]
1099 [__DynamicallyInvokable]
1102 return ToSByte((
double)value);
1111 [CLSCompliant(
false)]
1112 [__DynamicallyInvokable]
1124 [CLSCompliant(
false)]
1125 [__DynamicallyInvokable]
1128 return decimal.ToSByte(decimal.Round(value, 0));
1138 [CLSCompliant(
false)]
1139 [__DynamicallyInvokable]
1159 [CLSCompliant(
false)]
1160 [__DynamicallyInvokable]
1163 return sbyte.Parse(value,
NumberStyles.Integer, provider);
1170 [CLSCompliant(
false)]
1185 [__DynamicallyInvokable]
1205 [__DynamicallyInvokable]
1218 [__DynamicallyInvokable]
1232 [__DynamicallyInvokable]
1243 [__DynamicallyInvokable]
1258 [CLSCompliant(
false)]
1259 [__DynamicallyInvokable]
1274 [__DynamicallyInvokable]
1277 if (value < 0 || value > 255)
1289 [CLSCompliant(
false)]
1290 [__DynamicallyInvokable]
1305 [__DynamicallyInvokable]
1308 if (value < 0 || value > 255)
1320 [CLSCompliant(
false)]
1321 [__DynamicallyInvokable]
1336 [__DynamicallyInvokable]
1339 if (value < 0 || value > 255)
1351 [CLSCompliant(
false)]
1352 [__DynamicallyInvokable]
1368 [__DynamicallyInvokable]
1371 return ToByte((
double)value);
1380 [__DynamicallyInvokable]
1392 [__DynamicallyInvokable]
1395 return decimal.ToByte(decimal.Round(value, 0));
1405 [__DynamicallyInvokable]
1423 [__DynamicallyInvokable]
1430 return byte.Parse(value,
NumberStyles.Integer, provider);
1451 [__DynamicallyInvokable]
1471 [__DynamicallyInvokable]
1484 [__DynamicallyInvokable]
1499 [__DynamicallyInvokable]
1506 return (
short)value;
1512 [CLSCompliant(
false)]
1513 [__DynamicallyInvokable]
1522 [__DynamicallyInvokable]
1533 [CLSCompliant(
false)]
1534 [__DynamicallyInvokable]
1541 return (
short)value;
1549 [__DynamicallyInvokable]
1552 if (value < -32768 || value > 32767)
1556 return (
short)value;
1564 [CLSCompliant(
false)]
1565 [__DynamicallyInvokable]
1568 if ((
long)value > 32767
L)
1572 return (
short)value;
1579 [__DynamicallyInvokable]
1590 [__DynamicallyInvokable]
1593 if (value < -32768 || value > 32767)
1597 return (
short)value;
1605 [CLSCompliant(
false)]
1606 [__DynamicallyInvokable]
1613 return (
short)value;
1622 [__DynamicallyInvokable]
1625 return ToInt16((
double)value);
1634 [__DynamicallyInvokable]
1646 [__DynamicallyInvokable]
1649 return decimal.ToInt16(decimal.Round(value, 0));
1659 [__DynamicallyInvokable]
1677 [__DynamicallyInvokable]
1684 return short.Parse(value,
NumberStyles.Integer, provider);
1705 [CLSCompliant(
false)]
1706 [__DynamicallyInvokable]
1726 [CLSCompliant(
false)]
1727 [__DynamicallyInvokable]
1740 [CLSCompliant(
false)]
1741 [__DynamicallyInvokable]
1754 [CLSCompliant(
false)]
1755 [__DynamicallyInvokable]
1766 [CLSCompliant(
false)]
1767 [__DynamicallyInvokable]
1774 return (ushort)value;
1780 [CLSCompliant(
false)]
1781 [__DynamicallyInvokable]
1792 [CLSCompliant(
false)]
1793 [__DynamicallyInvokable]
1800 return (ushort)value;
1808 [CLSCompliant(
false)]
1809 [__DynamicallyInvokable]
1812 if (value < 0 || value > 65535)
1816 return (ushort)value;
1823 [CLSCompliant(
false)]
1824 [__DynamicallyInvokable]
1835 [CLSCompliant(
false)]
1836 [__DynamicallyInvokable]
1843 return (ushort)value;
1851 [CLSCompliant(
false)]
1852 [__DynamicallyInvokable]
1855 if (value < 0 || value > 65535)
1859 return (ushort)value;
1867 [CLSCompliant(
false)]
1868 [__DynamicallyInvokable]
1875 return (ushort)value;
1884 [CLSCompliant(
false)]
1885 [__DynamicallyInvokable]
1897 [CLSCompliant(
false)]
1898 [__DynamicallyInvokable]
1910 [CLSCompliant(
false)]
1911 [__DynamicallyInvokable]
1914 return decimal.ToUInt16(decimal.Round(value, 0));
1924 [CLSCompliant(
false)]
1925 [__DynamicallyInvokable]
1943 [CLSCompliant(
false)]
1944 [__DynamicallyInvokable]
1951 return ushort.Parse(value,
NumberStyles.Integer, provider);
1958 [CLSCompliant(
false)]
1973 [__DynamicallyInvokable]
1993 [__DynamicallyInvokable]
2006 [__DynamicallyInvokable]
2019 [__DynamicallyInvokable]
2028 [CLSCompliant(
false)]
2029 [__DynamicallyInvokable]
2038 [__DynamicallyInvokable]
2047 [__DynamicallyInvokable]
2056 [CLSCompliant(
false)]
2057 [__DynamicallyInvokable]
2068 [CLSCompliant(
false)]
2069 [__DynamicallyInvokable]
2072 if (value >
int.MaxValue)
2083 [__DynamicallyInvokable]
2094 [__DynamicallyInvokable]
2097 if (value < int.MinValue || value >
int.MaxValue)
2109 [CLSCompliant(
false)]
2110 [__DynamicallyInvokable]
2113 if (value >
int.MaxValue)
2126 [__DynamicallyInvokable]
2129 return ToInt32((
double)value);
2138 [__DynamicallyInvokable]
2143 if (value < 2147483647.5)
2145 int num = (int)value;
2146 double num2 = value - (double)num;
2147 if (num2 > 0.5 || (num2 == 0.5 && (num & 1) != 0))
2154 else if (value >= -2147483648.5)
2156 int num3 = (int)value;
2157 double num4 = value - (double)num3;
2158 if (num4 < -0.5 || (num4 == -0.5 && (num3 & 1) != 0))
2173 [SecuritySafeCritical]
2174 [__DynamicallyInvokable]
2177 return decimal.FCallToInt32(value);
2187 [__DynamicallyInvokable]
2205 [__DynamicallyInvokable]
2212 return int.Parse(value,
NumberStyles.Integer, provider);
2233 [CLSCompliant(
false)]
2234 [__DynamicallyInvokable]
2254 [CLSCompliant(
false)]
2255 [__DynamicallyInvokable]
2268 [CLSCompliant(
false)]
2269 [__DynamicallyInvokable]
2282 [CLSCompliant(
false)]
2283 [__DynamicallyInvokable]
2294 [CLSCompliant(
false)]
2295 [__DynamicallyInvokable]
2308 [CLSCompliant(
false)]
2309 [__DynamicallyInvokable]
2320 [CLSCompliant(
false)]
2321 [__DynamicallyInvokable]
2334 [CLSCompliant(
false)]
2335 [__DynamicallyInvokable]
2346 [CLSCompliant(
false)]
2347 [__DynamicallyInvokable]
2361 [CLSCompliant(
false)]
2362 [__DynamicallyInvokable]
2373 [CLSCompliant(
false)]
2374 [__DynamicallyInvokable]
2377 if (value < 0 || value > uint.MaxValue)
2389 [CLSCompliant(
false)]
2390 [__DynamicallyInvokable]
2393 if (value > uint.MaxValue)
2406 [CLSCompliant(
false)]
2407 [__DynamicallyInvokable]
2419 [CLSCompliant(
false)]
2420 [__DynamicallyInvokable]
2423 if (value >= -0.5 && value < 4294967295.5)
2425 uint num = (uint)value;
2426 double num2 = value - (double)num;
2427 if (num2 > 0.5 || (num2 == 0.5 && (num & 1) != 0))
2442 [CLSCompliant(
false)]
2443 [__DynamicallyInvokable]
2446 return decimal.ToUInt32(decimal.Round(value, 0));
2456 [CLSCompliant(
false)]
2457 [__DynamicallyInvokable]
2475 [CLSCompliant(
false)]
2476 [__DynamicallyInvokable]
2483 return uint.Parse(value,
NumberStyles.Integer, provider);
2490 [CLSCompliant(
false)]
2505 [__DynamicallyInvokable]
2525 [__DynamicallyInvokable]
2538 [__DynamicallyInvokable]
2541 return value ? 1 : 0;
2547 [__DynamicallyInvokable]
2556 [CLSCompliant(
false)]
2557 [__DynamicallyInvokable]
2566 [__DynamicallyInvokable]
2575 [__DynamicallyInvokable]
2584 [CLSCompliant(
false)]
2585 [__DynamicallyInvokable]
2594 [__DynamicallyInvokable]
2603 [CLSCompliant(
false)]
2604 [__DynamicallyInvokable]
2615 [CLSCompliant(
false)]
2616 [__DynamicallyInvokable]
2619 if (value >
long.MaxValue)
2630 [__DynamicallyInvokable]
2642 [__DynamicallyInvokable]
2645 return ToInt64((
double)value);
2654 [__DynamicallyInvokable]
2657 return checked((
long)
Math.
Round(value));
2666 [__DynamicallyInvokable]
2669 return decimal.ToInt64(decimal.Round(value, 0));
2679 [__DynamicallyInvokable]
2697 [__DynamicallyInvokable]
2704 return long.Parse(value,
NumberStyles.Integer, provider);
2725 [CLSCompliant(
false)]
2726 [__DynamicallyInvokable]
2746 [CLSCompliant(
false)]
2747 [__DynamicallyInvokable]
2760 [CLSCompliant(
false)]
2761 [__DynamicallyInvokable]
2774 [CLSCompliant(
false)]
2775 [__DynamicallyInvokable]
2786 [CLSCompliant(
false)]
2787 [__DynamicallyInvokable]
2794 return (ulong)value;
2800 [CLSCompliant(
false)]
2801 [__DynamicallyInvokable]
2812 [CLSCompliant(
false)]
2813 [__DynamicallyInvokable]
2820 return (ulong)value;
2826 [CLSCompliant(
false)]
2827 [__DynamicallyInvokable]
2838 [CLSCompliant(
false)]
2839 [__DynamicallyInvokable]
2846 return (ulong)value;
2852 [CLSCompliant(
false)]
2853 [__DynamicallyInvokable]
2864 [CLSCompliant(
false)]
2865 [__DynamicallyInvokable]
2872 return (ulong)value;
2879 [CLSCompliant(
false)]
2880 [__DynamicallyInvokable]
2892 [CLSCompliant(
false)]
2893 [__DynamicallyInvokable]
2905 [CLSCompliant(
false)]
2906 [__DynamicallyInvokable]
2909 return checked((ulong)
Math.
Round(value));
2918 [CLSCompliant(
false)]
2919 [__DynamicallyInvokable]
2922 return decimal.ToUInt64(decimal.Round(value, 0));
2932 [CLSCompliant(
false)]
2933 [__DynamicallyInvokable]
2951 [CLSCompliant(
false)]
2952 [__DynamicallyInvokable]
2959 return ulong.Parse(value,
NumberStyles.Integer, provider);
2966 [CLSCompliant(
false)]
2981 [__DynamicallyInvokable]
3001 [__DynamicallyInvokable]
3014 [CLSCompliant(
false)]
3015 [__DynamicallyInvokable]
3024 [__DynamicallyInvokable]
3042 [__DynamicallyInvokable]
3051 [CLSCompliant(
false)]
3052 [__DynamicallyInvokable]
3061 [__DynamicallyInvokable]
3070 [CLSCompliant(
false)]
3071 [__DynamicallyInvokable]
3074 return (
float)(double)value;
3080 [__DynamicallyInvokable]
3089 [CLSCompliant(
false)]
3090 [__DynamicallyInvokable]
3093 return (
float)(double)value;
3100 [__DynamicallyInvokable]
3110 [__DynamicallyInvokable]
3113 return (
float)value;
3120 [__DynamicallyInvokable]
3123 return (
float)value;
3133 [__DynamicallyInvokable]
3151 [__DynamicallyInvokable]
3164 [__DynamicallyInvokable]
3167 return value ? 1 : 0;
3188 [__DynamicallyInvokable]
3208 [__DynamicallyInvokable]
3221 [CLSCompliant(
false)]
3222 [__DynamicallyInvokable]
3231 [__DynamicallyInvokable]
3240 [__DynamicallyInvokable]
3258 [CLSCompliant(
false)]
3259 [__DynamicallyInvokable]
3268 [__DynamicallyInvokable]
3277 [CLSCompliant(
false)]
3278 [__DynamicallyInvokable]
3287 [__DynamicallyInvokable]
3296 [CLSCompliant(
false)]
3297 [__DynamicallyInvokable]
3306 [__DynamicallyInvokable]
3316 [__DynamicallyInvokable]
3325 [__DynamicallyInvokable]
3328 return (
double)value;
3338 [__DynamicallyInvokable]
3356 [__DynamicallyInvokable]
3369 [__DynamicallyInvokable]
3372 return value ? 1 : 0;
3393 [__DynamicallyInvokable]
3400 return decimal.Zero;
3413 [__DynamicallyInvokable]
3420 return decimal.Zero;
3426 [CLSCompliant(
false)]
3427 [__DynamicallyInvokable]
3436 [__DynamicallyInvokable]
3454 [__DynamicallyInvokable]
3463 [CLSCompliant(
false)]
3464 [__DynamicallyInvokable]
3473 [__DynamicallyInvokable]
3482 [CLSCompliant(
false)]
3483 [__DynamicallyInvokable]
3492 [__DynamicallyInvokable]
3501 [CLSCompliant(
false)]
3502 [__DynamicallyInvokable]
3513 [__DynamicallyInvokable]
3516 return (decimal)value;
3524 [__DynamicallyInvokable]
3527 return (decimal)value;
3537 [__DynamicallyInvokable]
3542 return decimal.Zero;
3555 [__DynamicallyInvokable]
3560 return decimal.Zero;
3562 return decimal.Parse(value,
NumberStyles.Number, provider);
3569 [__DynamicallyInvokable]
3578 [__DynamicallyInvokable]
3581 return value ? 1 : 0;
3609 [__DynamicallyInvokable]
3627 [__DynamicallyInvokable]
3642 [__DynamicallyInvokable]
3658 [__DynamicallyInvokable]
3672 [CLSCompliant(
false)]
3700 [CLSCompliant(
false)]
3719 [CLSCompliant(
false)]
3738 [CLSCompliant(
false)]
3792 [__DynamicallyInvokable]
3802 [__DynamicallyInvokable]
3806 if (convertible !=
null)
3808 return convertible.
ToString(provider);
3811 if (formattable !=
null)
3813 return formattable.
ToString(
null, provider);
3817 return value.ToString();
3819 return string.Empty;
3825 [__DynamicallyInvokable]
3828 return value.ToString();
3835 [__DynamicallyInvokable]
3838 return value.ToString(provider);
3844 [__DynamicallyInvokable]
3847 return char.ToString(value);
3854 [__DynamicallyInvokable]
3857 return value.ToString(provider);
3863 [CLSCompliant(
false)]
3864 [__DynamicallyInvokable]
3874 [CLSCompliant(
false)]
3875 [__DynamicallyInvokable]
3878 return value.ToString(provider);
3884 [__DynamicallyInvokable]
3894 [__DynamicallyInvokable]
3897 return value.ToString(provider);
3903 [__DynamicallyInvokable]
3913 [__DynamicallyInvokable]
3916 return value.ToString(provider);
3922 [CLSCompliant(
false)]
3923 [__DynamicallyInvokable]
3933 [CLSCompliant(
false)]
3934 [__DynamicallyInvokable]
3937 return value.ToString(provider);
3943 [__DynamicallyInvokable]
3953 [__DynamicallyInvokable]
3956 return value.ToString(provider);
3962 [CLSCompliant(
false)]
3963 [__DynamicallyInvokable]
3973 [CLSCompliant(
false)]
3974 [__DynamicallyInvokable]
3977 return value.ToString(provider);
3983 [__DynamicallyInvokable]
3993 [__DynamicallyInvokable]
3996 return value.ToString(provider);
4002 [CLSCompliant(
false)]
4003 [__DynamicallyInvokable]
4013 [CLSCompliant(
false)]
4014 [__DynamicallyInvokable]
4017 return value.ToString(provider);
4023 [__DynamicallyInvokable]
4033 [__DynamicallyInvokable]
4036 return value.ToString(provider);
4042 [__DynamicallyInvokable]
4052 [__DynamicallyInvokable]
4055 return value.ToString(provider);
4061 [__DynamicallyInvokable]
4071 [__DynamicallyInvokable]
4074 return value.ToString(provider);
4080 [__DynamicallyInvokable]
4083 return value.ToString();
4090 [__DynamicallyInvokable]
4093 return value.ToString(provider);
4129 [__DynamicallyInvokable]
4130 public static byte ToByte(
string value,
int fromBase)
4132 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4136 int num = ParseNumbers.StringToInt(value, fromBase, 4608);
4137 if (num < 0 || num > 255)
4158 [CLSCompliant(
false)]
4159 [__DynamicallyInvokable]
4160 public static sbyte
ToSByte(
string value,
int fromBase)
4162 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4166 int num = ParseNumbers.StringToInt(value, fromBase, 5120);
4167 if (fromBase != 10 && num <= 255)
4171 if (num < -128 || num > 127)
4192 [__DynamicallyInvokable]
4193 public static short ToInt16(
string value,
int fromBase)
4195 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4199 int num = ParseNumbers.StringToInt(value, fromBase, 6144);
4200 if (fromBase != 10 && num <= 65535)
4204 if (num < -32768 || num > 32767)
4225 [CLSCompliant(
false)]
4226 [__DynamicallyInvokable]
4227 public static ushort
ToUInt16(
string value,
int fromBase)
4229 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4233 int num = ParseNumbers.StringToInt(value, fromBase, 4608);
4234 if (num < 0 || num > 65535)
4255 [__DynamicallyInvokable]
4256 public static int ToInt32(
string value,
int fromBase)
4258 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4262 return ParseNumbers.StringToInt(value, fromBase, 4096);
4279 [CLSCompliant(
false)]
4280 [__DynamicallyInvokable]
4281 public static uint
ToUInt32(
string value,
int fromBase)
4283 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4287 return (uint)ParseNumbers.StringToInt(value, fromBase, 4608);
4304 [__DynamicallyInvokable]
4305 public static long ToInt64(
string value,
int fromBase)
4307 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4311 return ParseNumbers.StringToLong(value, fromBase, 4096);
4328 [CLSCompliant(
false)]
4329 [__DynamicallyInvokable]
4330 public static ulong
ToUInt64(
string value,
int fromBase)
4332 if (fromBase != 2 && fromBase != 8 && fromBase != 10 && fromBase != 16)
4336 return (ulong)ParseNumbers.StringToLong(value, fromBase, 4608);
4345 [SecuritySafeCritical]
4346 [__DynamicallyInvokable]
4349 if (toBase != 2 && toBase != 8 && toBase != 10 && toBase != 16)
4353 return ParseNumbers.IntToString(value, toBase, -1,
' ', 64);
4362 [SecuritySafeCritical]
4363 [__DynamicallyInvokable]
4366 if (toBase != 2 && toBase != 8 && toBase != 10 && toBase != 16)
4370 return ParseNumbers.IntToString(value, toBase, -1,
' ', 128);
4379 [SecuritySafeCritical]
4380 [__DynamicallyInvokable]
4383 if (toBase != 2 && toBase != 8 && toBase != 10 && toBase != 16)
4387 return ParseNumbers.IntToString(value, toBase, -1,
' ', 0);
4396 [SecuritySafeCritical]
4397 [__DynamicallyInvokable]
4400 if (toBase != 2 && toBase != 8 && toBase != 10 && toBase != 16)
4404 return ParseNumbers.LongToString(value, toBase, -1,
' ', 0);
4412 [__DynamicallyInvokable]
4415 if (inArray ==
null)
4434 if (inArray ==
null)
4451 [__DynamicallyInvokable]
4471 [SecuritySafeCritical]
4475 if (inArray ==
null)
4491 int num = inArray.Length;
4492 if (offset > num - length)
4498 return string.Empty;
4501 int length2 = ToBase64_CalculateAndValidateOutputLength(length, insertLineBreaks);
4502 string text =
string.FastAllocateString(length2);
4503 fixed (
char* outChars = text)
4505 fixed (
byte* inData = inArray)
4507 int num2 = ConvertToBase64Array(outChars, inData, offset, length, insertLineBreaks);
4526 [__DynamicallyInvokable]
4527 public static int ToBase64CharArray(
byte[] inArray,
int offsetIn,
int length,
char[] outArray,
int offsetOut)
4549 [SecuritySafeCritical]
4553 if (inArray ==
null)
4557 if (outArray ==
null)
4577 int num = inArray.Length;
4578 if (offsetIn > num - length)
4587 int num2 = outArray.Length;
4588 int num3 = ToBase64_CalculateAndValidateOutputLength(length, insertLineBreaks);
4589 if (offsetOut > num2 - num3)
4594 fixed (
char* outChars = &outArray[offsetOut])
4596 fixed (
byte* inData = inArray)
4598 result = ConvertToBase64Array(outChars, inData, offsetIn, length, insertLineBreaks);
4605 private unsafe
static int ConvertToBase64Array(
char* outChars,
byte* inData,
int offset,
int length,
bool insertLineBreaks)
4607 int num = length % 3;
4608 int num2 = offset + (length - num);
4611 char[] array = base64Table;
4612 fixed (
char* ptr = array)
4615 for (i = offset; i < num2; i += 3)
4617 if (insertLineBreaks)
4621 outChars[num3++] =
'\r';
4622 outChars[num3++] =
'\n';
4627 outChars[num3] = ptr[(inData[i] & 0xFC) >> 2];
4628 outChars[num3 + 1] = ptr[((inData[i] & 3) << 4) | ((inData[i + 1] & 0xF0) >> 4)];
4629 outChars[num3 + 2] = ptr[((inData[i + 1] & 0xF) << 2) | ((inData[i + 2] & 0xC0) >> 6)];
4630 outChars[num3 + 3] = ptr[inData[i + 2] & 0x3F];
4634 if (insertLineBreaks && num != 0 && num4 == 76)
4636 outChars[num3++] =
'\r';
4637 outChars[num3++] =
'\n';
4642 outChars[num3] = ptr[(inData[i] & 0xFC) >> 2];
4643 outChars[num3 + 1] = ptr[((inData[i] & 3) << 4) | ((inData[i + 1] & 0xF0) >> 4)];
4644 outChars[num3 + 2] = ptr[(inData[i + 1] & 0xF) << 2];
4645 outChars[num3 + 3] = ptr[64];
4649 outChars[num3] = ptr[(inData[i] & 0xFC) >> 2];
4650 outChars[num3 + 1] = ptr[(inData[i] & 3) << 4];
4651 outChars[num3 + 2] = ptr[64];
4652 outChars[num3 + 3] = ptr[64];
4660 private static int ToBase64_CalculateAndValidateOutputLength(
int inputLength,
bool insertLineBreaks)
4662 long num = (long)inputLength / 3
L * 4;
4663 num += ((inputLength % 3 != 0) ? 4 : 0);
4668 if (insertLineBreaks)
4670 long num2 = num / 76;
4677 if (num >
int.MaxValue)
4679 throw new OutOfMemoryException();
4690 [SecuritySafeCritical]
4691 [__DynamicallyInvokable]
4698 fixed (
char* inputPtr = s)
4700 return FromBase64CharPtr(inputPtr, s.Length);
4715 [SecuritySafeCritical]
4716 [__DynamicallyInvokable]
4719 if (inArray ==
null)
4731 if (offset > inArray.Length - length)
4735 fixed (
char* ptr = inArray)
4737 return FromBase64CharPtr(ptr + offset, length);
4742 private unsafe
static byte[] FromBase64CharPtr(
char* inputPtr,
int inputLength)
4744 while (inputLength > 0)
4746 int num = inputPtr[inputLength - 1];
4747 if (num != 32 && num != 10 && num != 13 && num != 9)
4753 int num2 = FromBase64_ComputeResultLength(inputPtr, inputLength);
4754 byte[] array =
new byte[num2];
4755 byte[] array2 = array;
4756 fixed (
byte* startDestPtr = array2)
4758 int num3 = FromBase64_Decode(inputPtr, inputLength, startDestPtr, num2);
4764 private unsafe
static int FromBase64_Decode(
char* startInputPtr,
int inputLength,
byte* startDestPtr,
int destLength)
4766 char* ptr = startInputPtr;
4767 byte* ptr2 = startDestPtr;
4768 char* ptr3 = ptr + inputLength;
4769 byte* ptr4 = ptr2 + destLength;
4848 num2 = (uint)((
int)num2 - -4);
4857 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64Char"));
4861 num = ((num << 6) | num2);
4862 if (((
int)num &
int.MinValue) != 0)
4864 if ((
int)(ptr4 - ptr2) < 3)
4868 *ptr2 = (byte)(num >> 16);
4869 ptr2[1] = (byte)(num >> 8);
4870 ptr2[2] = (byte)num;
4879 if (((
int)num &
int.MinValue) == 0)
4881 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64CharArrayLength"));
4883 if ((
int)(ptr4 - ptr2) < 2)
4887 byte* intPtr = ptr2;
4889 *intPtr = (byte)(num >> 16);
4890 byte* intPtr2 = ptr2;
4892 *intPtr2 = (byte)(num >> 8);
4896 for (; ptr < ptr3 - 1; ptr++)
4899 if (num3 != 32 && num3 != 10 && num3 != 13 && num3 != 9)
4904 if (ptr == ptr3 - 1 && *ptr ==
'=')
4907 if (((
int)num &
int.MinValue) == 0)
4909 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64CharArrayLength"));
4911 if ((
int)(ptr4 - ptr2) < 1)
4915 byte* intPtr3 = ptr2;
4917 *intPtr3 = (byte)(num >> 16);
4921 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64Char"));
4925 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64CharArrayLength"));
4927 return (
int)(ptr2 - startDestPtr);
4931 private unsafe
static int FromBase64_ComputeResultLength(
char* inputPtr,
int inputLength)
4933 char* ptr = inputPtr + inputLength;
4934 int num = inputLength;
4936 while (inputPtr < ptr)
4938 uint num3 = *inputPtr;
4992 throw new FormatException(Environment.GetResourceString(
"Format_BadBase64Char"));
4996 return num / 4 * 3 + num2;
static long ToInt64(string value)
Converts the specified string representation of a number to an equivalent 64-bit signed integer.
float ToSingle(IFormatProvider provider)
Converts the value of this instance to an equivalent single-precision floating-point number using the...
static sbyte ToSByte(string value)
Converts the specified string representation of a number to an equivalent 8-bit signed integer.
Converts a base data type to another base data type.
static Thread CurrentThread
Gets the currently running thread.
static DateTime ToDateTime(object value)
Converts the value of the specified object to a T:System.DateTime object.
static ulong ToUInt64(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 64-bit unsigned i...
static unsafe string ToBase64String(byte[] inArray, int offset, int length, Base64FormattingOptions options)
Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that...
static bool ToBoolean(decimal value)
Converts the value of the specified decimal number to an equivalent Boolean value.
static short ToInt16(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static decimal ToDecimal(bool value)
Converts the specified Boolean value to the equivalent decimal number.
static double ToDouble(bool value)
Converts the specified Boolean value to the equivalent double-precision floating-point number.
static ushort ToUInt16(ushort value)
Returns the specified 16-bit unsigned integer; no actual conversion is performed.
static object ChangeType(object value, Type conversionType)
Returns an object of the specified type and whose value is equivalent to the specified object.
static short ToInt16(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit signed integer.
static string ToString(char value)
Converts the value of the specified Unicode character to its equivalent string representation.
static char ToChar(byte value)
Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character.
static decimal ToDecimal(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent decimal number.
static decimal ToDecimal(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static long ToInt64(object value)
Converts the value of the specified object to a 64-bit signed integer.
static long ToInt64(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 64-bit si...
static char ToChar(short value)
Converts the value of the specified 16-bit signed integer to its equivalent Unicode character.
static double ToDouble(object value)
Converts the value of the specified object to a double-precision floating-point number.
static float ToSingle(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent single-precision floatin...
The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method th...
static string ToString(byte value)
Converts the value of the specified 8-bit unsigned integer to its equivalent string representation.
static uint ToUInt32(string value)
Converts the specified string representation of a number to an equivalent 32-bit unsigned integer.
static float ToSingle(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent single-precision floati...
static string ToString(decimal value)
Converts the value of the specified decimal number to its equivalent string representation.
static double ToDouble(string value)
Converts the specified string representation of a number to an equivalent double-precision floating-p...
static ulong ToUInt64(char value)
Converts the value of the specified Unicode character to the equivalent 64-bit unsigned integer.
static char ToChar(ushort value)
Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character.
static byte ToByte(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit unsigned integer.
static DateTime ToDateTime(decimal value)
Calling this method always throws T:System.InvalidCastException.
static uint ToUInt32(short value)
Converts the value of the specified 16-bit signed integer to the equivalent 32-bit unsigned integer.
static bool ToBoolean(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static short ToInt16(string value)
Converts the specified string representation of a number to an equivalent 16-bit signed integer.
static double ToDouble(int value)
Converts the value of the specified 32-bit signed integer to an equivalent double-precision floating-...
static uint ToUInt32(DateTime value)
Calling this method always throws T:System.InvalidCastException.
double ToDouble(IFormatProvider provider)
Converts the value of this instance to an equivalent double-precision floating-point number using the...
static short ToInt16(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit signed integer.
static ulong ToUInt64(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static byte ToByte(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 8-bit uns...
static double ToDouble(double value)
Returns the specified double-precision floating-point number; no actual conversion is performed.
static long ToInt64(short value)
Converts the value of the specified 16-bit signed integer to an equivalent 64-bit signed integer.
static int ToInt32(object value, IFormatProvider provider)
Converts the value of the specified object to a 32-bit signed integer, using the specified culture-sp...
static DateTime ToDateTime(ushort value)
Calling this method always throws T:System.InvalidCastException.
static char ToChar(float value)
Calling this method always throws T:System.InvalidCastException.
static float ToSingle(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent single-precision floating-p...
static string ToString(uint value)
Converts the value of the specified 32-bit unsigned integer to its equivalent string representation.
static DateTime ToDateTime(ulong value)
Calling this method always throws T:System.InvalidCastException.
static uint ToUInt32(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 32-bit un...
static uint ToUInt32(decimal value)
Converts the value of the specified decimal number to an equivalent 32-bit unsigned integer.
abstract string FullName
Gets the fully qualified name of the type, including its namespace but not its assembly.
static byte ToByte(bool value)
Converts the specified Boolean value to the equivalent 8-bit unsigned integer.
static long ToInt64(decimal value)
Converts the value of the specified decimal number to an equivalent 64-bit signed integer.
static readonly DateTime MinValue
Represents the smallest possible value of T:System.DateTime. This field is read-only.
static int ToInt32(string value)
Converts the specified string representation of a number to an equivalent 32-bit signed integer.
static string ToString(float value)
Converts the value of the specified single-precision floating-point number to its equivalent string r...
static bool ToBoolean(byte value)
Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value.
bool ToBoolean(IFormatProvider provider)
Converts the value of this instance to an equivalent Boolean value using the specified culture-specif...
TypeCode
Specifies the type of an object.
static ushort ToUInt16(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static string ToString(int value)
Converts the value of the specified 32-bit signed integer to its equivalent string representation.
static ulong ToUInt64(string value)
Converts the specified string representation of a number to an equivalent 64-bit unsigned integer.
static ulong ToUInt64(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 64-bit unsigned integer,...
static DateTime ToDateTime(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent date and time,...
static float ToSingle(object value)
Converts the value of the specified object to a single-precision floating-point number.
static string ToString(string value)
Returns the specified string instance; no actual conversion is performed.
static bool ToBoolean(sbyte value)
Converts the value of the specified 8-bit signed integer to an equivalent Boolean value.
static decimal ToDecimal(float value)
Converts the value of the specified single-precision floating-point number to the equivalent decimal ...
TypeCode GetTypeCode()
Returns the T:System.TypeCode for this instance.
static float ToSingle(object value, IFormatProvider provider)
Converts the value of the specified object to an single-precision floating-point number,...
static byte ToByte(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 8-bit unsigned integer.
static DateTime ToDateTime(object value, IFormatProvider provider)
Converts the value of the specified object to a T:System.DateTime object, using the specified culture...
The exception that is thrown when the value of an argument is outside the allowable range of values a...
static bool ToBoolean(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent Boolean value.
static sbyte ToSByte(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 8-bit sig...
The exception that is thrown for invalid casting or explicit conversion.
static DateTime ToDateTime(float value)
Calling this method always throws T:System.InvalidCastException.
static char ToChar(int value)
Converts the value of the specified 32-bit signed integer to its equivalent Unicode character.
static uint ToUInt32(char value)
Converts the value of the specified Unicode character to the equivalent 32-bit unsigned integer.
static byte ToByte(decimal value)
Converts the value of the specified decimal number to an equivalent 8-bit unsigned integer.
static sbyte ToSByte(sbyte value)
Returns the specified 8-bit signed integer; no actual conversion is performed.
static int ToInt32(decimal value)
Converts the value of the specified decimal number to an equivalent 32-bit signed integer.
static char ToChar(ulong value)
Converts the value of the specified 64-bit unsigned integer to its equivalent Unicode character.
static string ToString(short value)
Converts the value of the specified 16-bit signed integer to its equivalent string representation.
static byte ToByte(char value)
Converts the value of the specified Unicode character to the equivalent 8-bit unsigned integer.
char ToChar(IFormatProvider provider)
Converts the value of this instance to an equivalent Unicode character using the specified culture-sp...
static ushort ToUInt16(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 16-bit unsigned integer.
static ulong ToUInt64(decimal value)
Converts the value of the specified decimal number to an equivalent 64-bit unsigned integer.
static int ToInt32(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit signed integer.
static short ToInt16(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 16-bit signed int...
static ushort ToUInt16(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 16-bit un...
static long ToInt64(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 64-bit signed integer.
static byte ToByte(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 8-bit unsigned integer,...
static float ToSingle(string value)
Converts the specified string representation of a number to an equivalent single-precision floating-p...
static string ToString(byte value, IFormatProvider provider)
Converts the value of the specified 8-bit unsigned integer to its equivalent string representation,...
static string ToString(ulong value)
Converts the value of the specified 64-bit unsigned integer to its equivalent string representation.
static uint ToUInt32(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 32-bit unsigned integer.
static decimal ToDecimal(int value)
Converts the value of the specified 32-bit signed integer to an equivalent decimal number.
static long ToInt64(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit signed integer.
static char ToChar(char value)
Returns the specified Unicode character value; no actual conversion is performed.
static byte ToByte(short value)
Converts the value of the specified 16-bit signed integer to an equivalent 8-bit unsigned integer.
Represents an instant in time, typically expressed as a date and time of day. To browse the ....
static uint ToUInt32(uint value)
Returns the specified 32-bit unsigned integer; no actual conversion is performed.
static long ToInt64(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer.
static long ToInt64(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 64-bit signed integer.
static char ToChar(sbyte value)
Converts the value of the specified 8-bit signed integer to its equivalent Unicode character.
static double ToDouble(short value)
Converts the value of the specified 16-bit signed integer to an equivalent double-precision floating-...
static double ToDouble(float value)
Converts the value of the specified single-precision floating-point number to an equivalent double-pr...
static sbyte ToSByte(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 8-bit signed integer,...
static decimal ToDecimal(long value)
Converts the value of the specified 64-bit signed integer to an equivalent decimal number.
static sbyte ToSByte(char value)
Converts the value of the specified Unicode character to the equivalent 8-bit signed integer.
DateTime ToDateTime(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.DateTime using the specified culture-sp...
static ushort ToUInt16(string value)
Converts the specified string representation of a number to an equivalent 16-bit unsigned integer.
static uint ToUInt32(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 32-bit unsigned i...
sbyte ToSByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture...
static bool ToBoolean(int value)
Converts the value of the specified 32-bit signed integer to an equivalent Boolean value.
static string ToString(bool value)
Converts the specified Boolean value to its equivalent string representation.
static char ToChar(long value)
Converts the value of the specified 64-bit signed integer to its equivalent Unicode character.
static ushort ToUInt16(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 16-bit un...
static ulong ToUInt64(object value, IFormatProvider provider)
Converts the value of the specified object to a 64-bit unsigned integer, using the specified culture-...
static string ToString(sbyte value, IFormatProvider provider)
Converts the value of the specified 8-bit signed integer to its equivalent string representation,...
A type representing a date and time value.
static bool ToBoolean(float value)
Converts the value of the specified single-precision floating-point number to an equivalent Boolean v...
Base64FormattingOptions
Specifies whether relevant Overload:System.Convert.ToBase64CharArray and Overload:System....
The exception that is thrown when an arithmetic, casting, or conversion operation in a checked contex...
static string ToString(short value, IFormatProvider provider)
Converts the value of the specified 16-bit signed integer to its equivalent string representation,...
static string ToString(bool value, IFormatProvider provider)
Converts the specified Boolean value to its equivalent string representation.
NumberStyles
Determines the styles permitted in numeric string arguments that are passed to the Parse and TryParse...
static decimal ToDecimal(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent decimal number,...
static short ToInt16(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 16-bit signed integer.
static decimal ToDecimal(double value)
Converts the value of the specified double-precision floating-point number to an equivalent decimal n...
static uint ToUInt32(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 32-bit unsigned integer,...
static string ToBase64String(byte[] inArray)
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded ...
static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut)
Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character a...
static ulong ToUInt64(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 64-bit unsigned integer.
static ushort ToUInt16(char value)
Converts the value of the specified Unicode character to the equivalent 16-bit unsigned integer.
static float ToSingle(decimal value)
Converts the value of the specified decimal number to an equivalent single-precision floating-point n...
static bool ToBoolean(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent Boolean value.
static short ToInt16(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 16-bit signed integer.
static ushort ToUInt16(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 16-bit unsigned integer,...
static short ToInt16(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 16-bit si...
static long ToInt64(long value)
Returns the specified 64-bit signed integer; no actual conversion is performed.
static float ToSingle(float value)
Returns the specified single-precision floating-point number; no actual conversion is performed.
static double ToDouble(object value, IFormatProvider provider)
Converts the value of the specified object to an double-precision floating-point number,...
static bool ToBoolean(short value)
Converts the value of the specified 16-bit signed integer to an equivalent Boolean value.
static byte ToByte(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static int ToInt32(int value)
Returns the specified 32-bit signed integer; no actual conversion is performed.
static DateTime ToDateTime(char value)
Calling this method always throws T:System.InvalidCastException.
static double ToDouble(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent double-precision floatin...
static ushort ToUInt16(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 16-bit unsigned integer.
static char ToChar(object value)
Converts the value of the specified object to a Unicode character.
static string ToString(object value, IFormatProvider provider)
Converts the value of the specified object to its equivalent string representation using the specifie...
CultureInfo?? CurrentCulture
Gets or sets the culture for the current thread.
static string ToString(ulong value, IFormatProvider provider)
Converts the value of the specified 64-bit unsigned integer to its equivalent string representation,...
static char ToChar(string value, IFormatProvider provider)
Converts the first character of a specified string to a Unicode character, using specified culture-sp...
Provides information about, and means to manipulate, the current environment and platform....
static bool ToBoolean(object value)
Converts the value of a specified object to an equivalent Boolean value.
static DateTime Parse(string s)
Converts the string representation of a date and time to its T:System.DateTime equivalent.
decimal ToDecimal(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.Decimal number using the specified cult...
static string ToString(int value, IFormatProvider provider)
Converts the value of the specified 32-bit signed integer to its equivalent string representation,...
static int ToInt32(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 32-bit signed integer,...
static decimal ToDecimal(string value)
Converts the specified string representation of a number to an equivalent decimal number.
static ushort ToUInt16(short value)
Converts the value of the specified 16-bit signed integer to the equivalent 16-bit unsigned integer.
int ToInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit signed integer using the specified cultur...
static float ToSingle(int value)
Converts the value of the specified 32-bit signed integer to an equivalent single-precision floating-...
static string ToString(long value, int toBase)
Converts the value of a 64-bit signed integer to its equivalent string representation in a specified ...
Provides the base class for enumerations.
static uint ToUInt32(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit unsigned integer.
static decimal ToDecimal(ushort value)
Converts the value of the specified 16-bit unsigned integer to an equivalent decimal number.
static sbyte ToSByte(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 8-bit signed integer.
static char ToChar(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static char ToChar(decimal value)
Calling this method always throws T:System.InvalidCastException.
static short ToInt16(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 16-bit signed integer.
static readonly DBNull Value
Represents the sole instance of the T:System.DBNull class.
static DateTime ToDateTime(int value)
Calling this method always throws T:System.InvalidCastException.
static bool ToBoolean(double value)
Converts the value of the specified double-precision floating-point number to an equivalent Boolean v...
static ulong ToUInt64(ulong value)
Returns the specified 64-bit unsigned integer; no actual conversion is performed.
static ulong ToUInt64(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 64-bit unsigned integer.
static double Round(double a)
Rounds a double-precision floating-point value to the nearest integral value.
static int ToInt32(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit signed integer.
static string ToString(ushort value, IFormatProvider provider)
Converts the value of the specified 16-bit unsigned integer to its equivalent string representation,...
static object ChangeType(object value, Type conversionType, IFormatProvider provider)
Returns an object of the specified type whose value is equivalent to the specified object....
static string ToBase64String(byte[] inArray, int offset, int length)
Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that...
static DateTime ToDateTime(uint value)
Calling this method always throws T:System.InvalidCastException.
static string ToBase64String(byte[] inArray, Base64FormattingOptions options)
Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded ...
static ushort ToUInt16(object value)
Converts the value of the specified object to a 16-bit unsigned integer.
static byte ToByte(ushort value)
Converts the value of the specified 16-bit unsigned integer to an equivalent 8-bit unsigned integer.
object ToType(Type conversionType, IFormatProvider provider)
Converts the value of this instance to an T:System.Object of the specified T:System....
static sbyte ToSByte(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static sbyte ToSByte(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit signed integer.
static DateTime ToDateTime(DateTime value)
Returns the specified T:System.DateTime object; no actual conversion is performed.
static float ToSingle(long value)
Converts the value of the specified 64-bit signed integer to an equivalent single-precision floating-...
static sbyte ToSByte(object value)
Converts the value of the specified object to an 8-bit signed integer.
static string ToString(double value, IFormatProvider provider)
Converts the value of the specified double-precision floating-point number to its equivalent string r...
Represents type declarations: class types, interface types, array types, value types,...
static byte ToByte(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit unsigned integer.
static ulong ToUInt64(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 64-bit un...
static bool ToBoolean(ushort value)
Converts the value of the specified 16-bit unsigned integer to an equivalent Boolean value.
static DateTime ToDateTime(byte value)
Calling this method always throws T:System.InvalidCastException.
static float ToSingle(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent single-precision floatin...
static string ToString(char value, IFormatProvider provider)
Converts the value of the specified Unicode character to its equivalent string representation,...
string ToString(IFormatProvider provider)
Converts the value of this instance to an equivalent T:System.String using the specified culture-spec...
ushort ToUInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified cult...
static double ToDouble(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent double-precision floati...
static int ToInt32(bool value)
Converts the specified Boolean value to the equivalent 32-bit signed integer.
static ulong ToUInt64(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 64-bit unsigned integer.
static object ChangeType(object value, TypeCode typeCode)
Returns an object of the specified type whose value is equivalent to the specified object.
static uint ToUInt32(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 32-bit unsigned integer.
static bool ToBoolean(bool value)
Returns the specified Boolean value; no actual conversion is performed.
static double ToDouble(decimal value)
Converts the value of the specified decimal number to an equivalent double-precision floating-point n...
static byte ToByte(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 8-bit unsigned integer.
DateTime IConvertible. ToDateTime(IFormatProvider provider)
Returns the current T:System.DateTime object.
static string ToString(long value, IFormatProvider provider)
Converts the value of the specified 64-bit signed integer to its equivalent string representation,...
static uint ToUInt32(object value)
Converts the value of the specified object to a 32-bit unsigned integer.
static TypeCode GetTypeCode(object value)
Returns the T:System.TypeCode for the specified object.
static int ToInt32(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 32-bit si...
bool IsValueType
Gets a value indicating whether the T:System.Type is a value type.
static long ToInt64(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 64-bit signed integer,...
static int ToInt32(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 32-bit si...
static byte ToByte(sbyte value)
Converts the value of the specified 8-bit signed integer to an equivalent 8-bit unsigned integer.
static byte ToByte(byte value)
Returns the specified 8-bit unsigned integer; no actual conversion is performed.
static long ToInt64(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 64-bit si...
static uint ToUInt32(object value, IFormatProvider provider)
Converts the value of the specified object to a 32-bit unsigned integer, using the specified culture-...
short ToInt16(IFormatProvider provider)
Converts the value of this instance to an equivalent 16-bit signed integer using the specified cultur...
static string ToString(double value)
Converts the value of the specified double-precision floating-point number to its equivalent string r...
static DateTime ToDateTime(string value)
Converts the specified string representation of a date and time to an equivalent date and time value.
static ushort ToUInt16(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit unsigned integer.
static string ToString(float value, IFormatProvider provider)
Converts the value of the specified single-precision floating-point number to its equivalent string r...
static decimal ToDecimal(object value)
Converts the value of the specified object to an equivalent decimal number.
static long ToInt64(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 64-bit signed int...
static short ToInt16(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 16-bit signed integer.
static long ToInt64(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 64-bit signed integer.
static byte ToByte(object value, IFormatProvider provider)
Converts the value of the specified object to an 8-bit unsigned integer, using the specified culture-...
static ushort ToUInt16(bool value)
Converts the specified Boolean value to the equivalent 16-bit unsigned integer.
static CultureInfo CurrentCulture
Gets or sets the T:System.Globalization.CultureInfo object that represents the culture used by the cu...
long ToInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit signed integer using the specified cultur...
The exception that is thrown when one of the arguments provided to a method is not valid.
static short ToInt16(short value)
Returns the specified 16-bit signed integer; no actual conversion is performed.
static ulong ToUInt64(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 64-bit un...
static float ToSingle(short value)
Converts the value of the specified 16-bit signed integer to an equivalent single-precision floating-...
static uint ToUInt32(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 32-bit unsigned integer.
static sbyte ToSByte(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 8-bit signed integer.
static int ToInt32(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer.
static char ToChar(bool value)
Calling this method always throws T:System.InvalidCastException.
static string ToString(DateTime value, IFormatProvider provider)
Converts the value of the specified T:System.DateTime to its equivalent string representation,...
static uint ToUInt32(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 32-bit un...
static string ToString(byte value, int toBase)
Converts the value of an 8-bit unsigned integer to its equivalent string representation in a specifie...
static long ToInt64(char value)
Converts the value of the specified Unicode character to the equivalent 64-bit signed integer.
static decimal ToDecimal(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent decimal number.
static decimal ToDecimal(object value, IFormatProvider provider)
Converts the value of the specified object to an equivalent decimal number, using the specified cultu...
static bool ToBoolean(string value)
Converts the specified string representation of a logical value to its Boolean equivalent.
static bool ToBoolean(char value)
Calling this method always throws T:System.InvalidCastException.
static decimal ToDecimal(decimal value)
Returns the specified decimal number; no actual conversion is performed.
static bool ToBoolean(long value)
Converts the value of the specified 64-bit signed integer to an equivalent Boolean value.
static string ToString(decimal value, IFormatProvider provider)
Converts the value of the specified decimal number to its equivalent string representation,...
static byte ToByte(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 8-bit uns...
static short ToInt16(object value, IFormatProvider provider)
Converts the value of the specified object to a 16-bit signed integer, using the specified culture-sp...
Attribute can be applied to an enumeration.
static sbyte ToSByte(bool value)
Converts the specified Boolean value to the equivalent 8-bit signed integer.
static char ToChar(string value)
Converts the first character of a specified string to a Unicode character.
static ushort ToUInt16(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit unsigned integer.
static ulong ToUInt64(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit unsigned integer...
static unsafe int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut, Base64FormattingOptions options)
Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character a...
static unsafe byte [] FromBase64String(string s)
Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit un...
static sbyte ToSByte(double value)
Converts the value of the specified double-precision floating-point number to an equivalent 8-bit sig...
static ushort ToUInt16(object value, IFormatProvider provider)
Converts the value of the specified object to a 16-bit unsigned integer, using the specified culture-...
static long ToInt64(bool value)
Converts the specified Boolean value to the equivalent 64-bit signed integer.
static byte ToByte(object value)
Converts the value of the specified object to an 8-bit unsigned integer.
static char ToChar(double value)
Calling this method always throws T:System.InvalidCastException.
static float ToSingle(bool value)
Converts the specified Boolean value to the equivalent single-precision floating-point number.
static DateTime ToDateTime(double value)
Calling this method always throws T:System.InvalidCastException.
static int ToInt32(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 32-bit signed integer.
static string ToString(long value)
Converts the value of the specified 64-bit signed integer to its equivalent string representation.
static float ToSingle(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent single-precision floatin...
static string ToString(ushort value)
Converts the value of the specified 16-bit unsigned integer to its equivalent string representation.
static object ChangeType(object value, TypeCode typeCode, IFormatProvider provider)
Returns an object of the specified type whose value is equivalent to the specified object....
static float ToSingle(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent single-precision floating-...
static double ToDouble(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static char ToChar(uint value)
Converts the value of the specified 32-bit unsigned integer to its equivalent Unicode character.
static uint ToUInt32(bool value)
Converts the specified Boolean value to the equivalent 32-bit unsigned integer.
static int ToInt32(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 32-bit signed int...
static short ToInt16(object value)
Converts the value of the specified object to a 16-bit signed integer.
static float ToSingle(double value)
Converts the value of the specified double-precision floating-point number to an equivalent single-pr...
static long ToInt64(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit signed integer.
static DateTime ToDateTime(short value)
Calling this method always throws T:System.InvalidCastException.
static char ToChar(object value, IFormatProvider provider)
Converts the value of the specified object to its equivalent Unicode character, using the specified c...
static decimal ToDecimal(short value)
Converts the value of the specified 16-bit signed integer to an equivalent decimal number.
static string ToString(object value)
Converts the value of the specified object to its equivalent string representation.
static sbyte ToSByte(short value)
Converts the value of the specified 16-bit signed integer to the equivalent 8-bit signed integer.
static bool ToBoolean(string value, IFormatProvider provider)
Converts the specified string representation of a logical value to its Boolean equivalent,...
static string ToString(DateTime value)
Converts the value of the specified T:System.DateTime to its equivalent string representation.
static short ToInt16(decimal value)
Converts the value of the specified decimal number to an equivalent 16-bit signed integer.
static DateTime ToDateTime(long value)
Calling this method always throws T:System.InvalidCastException.
static sbyte ToSByte(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 8-bit signed integer.
static double ToDouble(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent double-precision floatin...
static DateTime ToDateTime(bool value)
Calling this method always throws T:System.InvalidCastException.
static double ToDouble(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent double-precision floating-...
static byte ToByte(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 8-bit unsigned in...
static ulong ToUInt64(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit unsigned integer.
static float ToSingle(char value)
Calling this method always throws T:System.InvalidCastException.
static byte ToByte(string value)
Converts the specified string representation of a number to an equivalent 8-bit unsigned integer.
static int ToInt32(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 32-bit signed integer.
static DateTime ToDateTime(sbyte value)
Calling this method always throws T:System.InvalidCastException.
ulong ToUInt64(IFormatProvider provider)
Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified cult...
static ulong ToUInt64(bool value)
Converts the specified Boolean value to the equivalent 64-bit unsigned integer.
static ulong ToUInt64(object value)
Converts the value of the specified object to a 64-bit unsigned integer.
static double ToDouble(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent double-precision floatin...
static string ToString(short value, int toBase)
Converts the value of a 16-bit signed integer to its equivalent string representation in a specified ...
static ulong ToUInt64(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit unsigned integer.
static int ToInt32(object value)
Converts the value of the specified object to a 32-bit signed integer.
byte ToByte(IFormatProvider provider)
Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified cultu...
Provides constants and static methods for trigonometric, logarithmic, and other common mathematical f...
Provides information about a specific culture (called a locale for unmanaged code development)....
static unsafe byte [] FromBase64CharArray(char[] inArray, int offset, int length)
Converts a subset of a Unicode character array, which encodes binary data as base-64 digits,...
static string ToString(string value, IFormatProvider provider)
Returns the specified string instance; no actual conversion is performed.
static sbyte ToSByte(decimal value)
Converts the value of the specified decimal number to an equivalent 8-bit signed integer.
Defines methods that convert the value of the implementing reference or value type to a common langua...
static sbyte ToSByte(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit signed integer.
static ulong ToUInt64(short value)
Converts the value of the specified 16-bit signed integer to the equivalent 64-bit unsigned integer.
static double ToDouble(long value)
Converts the value of the specified 64-bit signed integer to an equivalent double-precision floating-...
static short ToInt16(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent 16-bit signed integer,...
static int ToInt32(short value)
Converts the value of the specified 16-bit signed integer to an equivalent 32-bit signed integer.
static ushort ToUInt16(int value)
Converts the value of the specified 32-bit signed integer to an equivalent 16-bit unsigned integer.
static sbyte ToSByte(object value, IFormatProvider provider)
Converts the value of the specified object to an 8-bit signed integer, using the specified culture-sp...
static string ToString(int value, int toBase)
Converts the value of a 32-bit signed integer to its equivalent string representation in a specified ...
static short ToInt16(float value)
Converts the value of the specified single-precision floating-point number to an equivalent 16-bit si...
static double ToDouble(char value)
Calling this method always throws T:System.InvalidCastException.
static double ToDouble(string value, IFormatProvider provider)
Converts the specified string representation of a number to an equivalent double-precision floating-p...
static bool IsDBNull(object value)
Returns an indication whether the specified object is of type T:System.DBNull.
static string ToString(sbyte value)
Converts the value of the specified 8-bit signed integer to its equivalent string representation.
static ushort ToUInt16(ulong value)
Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit unsigned integer.
static decimal ToDecimal(char value)
Calling this method always throws T:System.InvalidCastException.
static short ToInt16(char value)
Converts the value of the specified Unicode character to the equivalent 16-bit signed integer.
static uint ToUInt32(ushort value)
Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit unsigned integer...
uint ToUInt32(IFormatProvider provider)
Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified cult...
static short ToInt16(bool value)
Converts the specified Boolean value to the equivalent 16-bit signed integer.
static decimal ToDecimal(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent decimal number.
static int ToInt32(char value)
Converts the value of the specified Unicode character to the equivalent 32-bit signed integer.
static int ToInt32(sbyte value)
Converts the value of the specified 8-bit signed integer to the equivalent 32-bit signed integer.
static float ToSingle(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static ushort ToUInt16(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 16-bit unsigned i...
static short ToInt16(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer.
static decimal ToDecimal(uint value)
Converts the value of the specified 32-bit unsigned integer to an equivalent decimal number.
static ushort ToUInt16(decimal value)
Converts the value of the specified decimal number to an equivalent 16-bit unsigned integer.
static sbyte ToSByte(string value, int fromBase)
Converts the string representation of a number in a specified base to an equivalent 8-bit signed inte...
Represents a nonexistent value. This class cannot be inherited.
static bool ToBoolean(object value, IFormatProvider provider)
Converts the value of the specified object to an equivalent Boolean value, using the specified cultur...
static long ToInt64(DateTime value)
Calling this method always throws T:System.InvalidCastException.
static sbyte ToSByte(long value)
Converts the value of the specified 64-bit signed integer to an equivalent 8-bit signed integer.
static string ToString(uint value, IFormatProvider provider)
Converts the value of the specified 32-bit unsigned integer to its equivalent string representation,...
static uint ToUInt32(byte value)
Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit unsigned integer.
Creates and controls a thread, sets its priority, and gets its status.
static long ToInt64(object value, IFormatProvider provider)
Converts the value of the specified object to a 64-bit signed integer, using the specified culture-sp...
static int ToInt32(DateTime value)
Calling this method always throws T:System.InvalidCastException.