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 GetInterval(object x, object y)
 {
     if (AreTypes.DateTime(x, y))
     {
         return(((DateTime)x).GetInterval((DateTime)y).Ticks);
     }
     return(null);
 }
Esempio n. 4
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);
        }