Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 3
0
 public static object StartsWith(object x, object y)
 {
     if (AreTypes.String(x, y))
     {
         return(Strings.StartsWith((string)x, (string)y));
     }
     return(null);
 }
Esempio n. 4
0
 public static object Contains(object x, object y)
 {
     if (AreTypes.String(x, y))
     {
         return(Strings.Contains((string)x, (string)y));
     }
     return(null);
 }
Esempio n. 5
0
 public static object GetInterval(object x, object y)
 {
     if (AreTypes.DateTime(x, y))
     {
         return(((DateTime)x).GetInterval((DateTime)y).Ticks);
     }
     return(null);
 }
Esempio n. 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);
        }
Esempio n. 7
0
        public static object Not(object x)
        {
            if (AreTypes.Bool(x))
            {
                return(((bool)x).Not());
            }

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

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

            return(null);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }