Boo.Lang.Runtime.RuntimeServices.op_UnaryNegation C# (CSharp) Метод

op_UnaryNegation() приватный статический Метод

private static op_UnaryNegation ( object operand, TypeCode operandTypeCode ) : object
operand object
operandTypeCode TypeCode
Результат object
        private static object op_UnaryNegation(object operand, TypeCode operandTypeCode)
        {
            IConvertible operandConvertible = (IConvertible)operand;

            switch (operandTypeCode)
            {
                case TypeCode.Decimal:
                    return -operandConvertible.ToDecimal(null);
                case TypeCode.Double:
                    return -operandConvertible.ToDouble(null);
                case TypeCode.Single:
                    return -operandConvertible.ToSingle(null);
                case TypeCode.UInt64:
                    return -operandConvertible.ToInt64(null);
                case TypeCode.Int64:
                    return -operandConvertible.ToInt64(null);
                case TypeCode.UInt32:
                    return -operandConvertible.ToInt64(null);
                default:
                    return -operandConvertible.ToInt32(null);
            }
        }
RuntimeServices