493 {
494 if (typeof(TOther) == typeof(byte))
495 {
496 return (
byte)(object)
value;
497 }
498 if (typeof(TOther) == typeof(char))
499 {
500 return (
char)(object)
value;
501 }
502 if (typeof(TOther) == typeof(decimal))
503 {
504 decimal num = (decimal)(
object)
value;
505 if (!(num > 4294967295m))
506 {
507 if (!(num < 0m))
508 {
509 return (uint)num;
510 }
511 return 0u;
512 }
513 return uint.MaxValue;
514 }
515 if (typeof(TOther) == typeof(double))
516 {
517 double num2 = (double)(
object)
value;
518 if (!(num2 > 4294967295.0))
519 {
520 if (!(num2 < 0.0))
521 {
522 return (uint)num2;
523 }
524 return 0u;
525 }
526 return uint.MaxValue;
527 }
528 if (typeof(TOther) == typeof(short))
529 {
531 if (num3 >= 0)
532 {
533 return (uint)num3;
534 }
535 return 0u;
536 }
537 if (typeof(TOther) == typeof(int))
538 {
539 int num4 = (int)(
object)
value;
540 if (num4 >= 0)
541 {
542 return (uint)num4;
543 }
544 return 0u;
545 }
546 if (typeof(TOther) == typeof(long))
547 {
548 long num5 = (long)(
object)
value;
549 if (num5 <= uint.MaxValue)
550 {
551 if (num5 >= 0)
552 {
553 return (uint)num5;
554 }
555 return 0u;
556 }
557 return uint.MaxValue;
558 }
559 if (typeof(TOther) == typeof(IntPtr))
560 {
562 if ((nint)intPtr <= uint.MaxValue)
563 {
564 if ((nint)intPtr >= 0)
565 {
566 return (uint)(nint)intPtr;
567 }
568 return 0u;
569 }
570 return uint.MaxValue;
571 }
572 if (typeof(TOther) == typeof(sbyte))
573 {
574 sbyte b = (sbyte)(
object)
value;
575 if (b >= 0)
576 {
577 return (uint)b;
578 }
579 return 0u;
580 }
581 if (typeof(TOther) == typeof(float))
582 {
583 float num6 = (float)(
object)
value;
584 if (!(num6 > 4.2949673
E+09f))
585 {
586 if (!(num6 < 0f))
587 {
588 return (uint)num6;
589 }
590 return 0u;
591 }
592 return uint.MaxValue;
593 }
594 if (typeof(TOther) == typeof(ushort))
595 {
596 return (ushort)(object)
value;
597 }
598 if (typeof(TOther) == typeof(uint))
599 {
600 return (uint)(object)
value;
601 }
602 if (typeof(TOther) == typeof(ulong))
603 {
604 ulong num7 = (ulong)(
object)
value;
605 if (num7 <= uint.MaxValue)
606 {
607 return (uint)num7;
608 }
609 return uint.MaxValue;
610 }
611 if (typeof(TOther) == typeof(UIntPtr))
612 {
614 if ((nuint)uIntPtr <= uint.MaxValue)
615 {
616 return (uint)(nuint)uIntPtr;
617 }
618 return uint.MaxValue;
619 }
620 ThrowHelper.ThrowNotSupportedException();
621 return 0u;
622 }