コード例 #1
0
        public static bool Equals <T>(params object[] args) where T : IComparable
        {
            T x = args[0].GetType() == typeof(string) ? LogBook.Get <T>((string)args[0]) : (T)args[0];
            T y = args[1].GetType() == typeof(string) ? LogBook.Get <T>((string)args[1]) : (T)args[1];

            return(x.Equals(y));
        }
コード例 #2
0
        // strings will always be ref-type
        public static bool GreaterThan <T>(params object[] args) where T : IComparable
        {
            T x = args[0].GetType() == typeof(string) ? LogBook.Get <T>((string)args[0]) : (T)args[0];
            T y = args[1].GetType() == typeof(string) ? LogBook.Get <T>((string)args[1]) : (T)args[1];

            return(x.CompareTo(y) > 0);
        }