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

◆ TryCreate< TOther >() [1/2]

static bool INumber< decimal >. System.Decimal.TryCreate< TOther > ( TOther value,
out decimal result )
inlinestatic

Definition at line 3407 of file Decimal.cs.

3408 {
3409 if (typeof(TOther) == typeof(byte))
3410 {
3411 result = (byte)(object)value;
3412 return true;
3413 }
3414 if (typeof(TOther) == typeof(char))
3415 {
3416 result = (char)(object)value;
3417 return true;
3418 }
3419 if (typeof(TOther) == typeof(decimal))
3420 {
3421 result = (decimal)(object)value;
3422 return true;
3423 }
3424 if (typeof(TOther) == typeof(double))
3425 {
3426 result = (decimal)(double)(object)value;
3427 return true;
3428 }
3429 if (typeof(TOther) == typeof(short))
3430 {
3431 result = (short)(object)value;
3432 return true;
3433 }
3434 if (typeof(TOther) == typeof(int))
3435 {
3436 result = (int)(object)value;
3437 return true;
3438 }
3439 if (typeof(TOther) == typeof(long))
3440 {
3441 result = (long)(object)value;
3442 return true;
3443 }
3444 if (typeof(TOther) == typeof(IntPtr))
3445 {
3446 result = (long)(IntPtr)(object)value;
3447 return true;
3448 }
3449 if (typeof(TOther) == typeof(sbyte))
3450 {
3451 result = (sbyte)(object)value;
3452 return true;
3453 }
3454 if (typeof(TOther) == typeof(float))
3455 {
3456 result = (decimal)(float)(object)value;
3457 return true;
3458 }
3459 if (typeof(TOther) == typeof(ushort))
3460 {
3461 result = (ushort)(object)value;
3462 return true;
3463 }
3464 if (typeof(TOther) == typeof(uint))
3465 {
3466 result = (uint)(object)value;
3467 return true;
3468 }
3469 if (typeof(TOther) == typeof(ulong))
3470 {
3471 result = (ulong)(object)value;
3472 return true;
3473 }
3474 if (typeof(TOther) == typeof(UIntPtr))
3475 {
3476 result = (ulong)(UIntPtr)(object)value;
3477 return true;
3478 }
3479 ThrowHelper.ThrowNotSupportedException();
3480 result = default(decimal);
3481 return false;
3482 }

References System.Runtime.Serialization.Dictionary, System.ThrowHelper.ThrowNotSupportedException(), and System.value.