451 {
454 if (
value.Length == 0)
455 {
456 if (throwOnFailure)
457 {
459 }
460 result = null;
461 return false;
462 }
463 int result3;
464 uint result4;
465 switch (
Type.GetTypeCode(runtimeType))
466 {
467 case TypeCode.SByte:
468 {
469 bool flag =
TryParseInt32Enum(runtimeType,
value, -128, 127, ignoreCase, throwOnFailure, TypeCode.SByte, out result3);
471 return flag;
472 }
473 case TypeCode.Int16:
474 {
475 bool flag =
TryParseInt32Enum(runtimeType,
value, -32768, 32767, ignoreCase, throwOnFailure, TypeCode.Int16, out result3);
477 return flag;
478 }
479 case TypeCode.Int32:
480 {
483 return flag;
484 }
485 case TypeCode.Byte:
486 {
487 bool flag =
TryParseUInt32Enum(runtimeType,
value, 255u, ignoreCase, throwOnFailure, TypeCode.Byte, out result4);
489 return flag;
490 }
491 case TypeCode.UInt16:
492 {
493 bool flag =
TryParseUInt32Enum(runtimeType,
value, 65535u, ignoreCase, throwOnFailure, TypeCode.UInt16, out result4);
495 return flag;
496 }
497 case TypeCode.UInt32:
498 {
499 bool flag =
TryParseUInt32Enum(runtimeType,
value, uint.MaxValue, ignoreCase, throwOnFailure, TypeCode.UInt32, out result4);
501 return flag;
502 }
503 case TypeCode.Int64:
504 {
505 long result5;
508 return flag;
509 }
510 case TypeCode.UInt64:
511 {
512 ulong result2;
515 return flag;
516 }
517 default:
519 }
520 }
static bool TryParseUInt64Enum(RuntimeType enumType, ReadOnlySpan< char > value, bool ignoreCase, bool throwOnFailure, out ulong result)
static bool TryParseRareEnum(RuntimeType enumType, ReadOnlySpan< char > value, bool ignoreCase, bool throwOnFailure, [NotNullWhen(true)] out object result)
static bool TryParseInt64Enum(RuntimeType enumType, ReadOnlySpan< char > value, bool ignoreCase, bool throwOnFailure, out long result)
static object InternalBoxEnum(RuntimeType enumType, long value)
static bool TryParseInt32Enum(RuntimeType enumType, ReadOnlySpan< char > value, int minInclusive, int maxInclusive, bool ignoreCase, bool throwOnFailure, TypeCode type, out int result)
static RuntimeType ValidateRuntimeType(Type enumType)
static bool TryParseUInt32Enum(RuntimeType enumType, ReadOnlySpan< char > value, uint maxInclusive, bool ignoreCase, bool throwOnFailure, TypeCode type, out uint result)