示例#1
0
        public static object Add(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).Add((bool)y));
            }
            if (AreTypes.String(x, y))
            {
                return(Strings.Add((string)x, (string)y));
            }
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).AddSafe((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Add(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Add(Doubles.ToDouble(y)));
            }

            return(null);
        }
示例#2
0
        public static object IsGreater(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).IsGreater((bool)y));
            }
            if (AreTypes.String(x, y))
            {
                return(((string)x).IsGreater((string)y));
            }
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).IsGreater((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).IsGreater(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).IsGreater(Doubles.ToDouble(y)));
            }

            return(null);
        }
示例#3
0
 public static object StartsWith(object x, object y)
 {
     if (AreTypes.String(x, y))
     {
         return(Strings.StartsWith((string)x, (string)y));
     }
     return(null);
 }
示例#4
0
 public static object Contains(object x, object y)
 {
     if (AreTypes.String(x, y))
     {
         return(Strings.Contains((string)x, (string)y));
     }
     return(null);
 }
示例#5
0
 public static object GetInterval(object x, object y)
 {
     if (AreTypes.DateTime(x, y))
     {
         return(((DateTime)x).GetInterval((DateTime)y).Ticks);
     }
     return(null);
 }
示例#6
0
        public static object Power(object x, object y)
        {
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Power(Doubles.ToDouble(y)));
            }

            return(null);
        }
示例#7
0
        public static object Not(object x)
        {
            if (AreTypes.Bool(x))
            {
                return(((bool)x).Not());
            }

            return(null);
        }
示例#8
0
        public static object Xor(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).Xor((bool)y));
            }

            return(null);
        }
示例#9
0
        public static object Sqrt(object x)
        {
            if (AreTypes.AnyDouble(x))
            {
                return(Doubles.ToDouble(x).Sqrt());
            }

            return(null);
        }
示例#10
0
        public static object Substring(object x, object y, object z)
        {
            if (!IsType.String(x) || !AreTypes.AnyInt(y, z))
            {
                return(null);
            }
            var r = Strings.Substring((string)x, Integers.ToInteger(y), Integers.ToInteger(z));

            return(r);
        }
示例#11
0
        public static object Inverse(object x)
        {
            if (AreTypes.AnyDecimal(x))
            {
                return(Converting.ToDecimal(x).Inverse());
            }
            if (AreTypes.AnyDouble(x))
            {
                return(Doubles.ToDouble(x).Inverse());
            }

            return(null);
        }
示例#12
0
        public static object Divide(object x, object y)
        {
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Divide(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Divide(Doubles.ToDouble(y)));
            }

            return(null);
        }
示例#13
0
        public static object Multiply(object x, object y)
        {
            if (AreTypes.Bool(x, y))
            {
                return(((bool)x).Multiply((bool)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Multiply(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Multiply(Doubles.ToDouble(y)));
            }

            return(null);
        }
示例#14
0
        public static object Subtract(object x, object y)
        {
            if (AreTypes.DateTime(x, y))
            {
                return(((DateTime)x).SubtractSafe((DateTime)y));
            }
            if (AreTypes.AnyDecimal(x, y))
            {
                return(Converting.ToDecimal(x).Subtract(Converting.ToDecimal(y)));
            }
            if (AreTypes.AnyDouble(x, y))
            {
                return(Doubles.ToDouble(x).Subtract(Doubles.ToDouble(y)));
            }

            return(null);
        }