public static bool Check <T>(T v1, Utils.Comparer.Type compEnum, T v2) where T : IComparable { int num = v1.CompareTo((object)v2); switch (compEnum) { case Utils.Comparer.Type.Equal: return(num == 0); case Utils.Comparer.Type.NotEqual: return(num != 0); case Utils.Comparer.Type.Over: return(num >= 0); case Utils.Comparer.Type.Under: return(num <= 0); case Utils.Comparer.Type.Greater: return(num > 0); case Utils.Comparer.Type.Lesser: return(num < 0); default: return(false); } }
private static bool IF(Utils.Comparer.Type type, object a, object b) { return(Utils.Comparer.Check <IComparable>((IComparable)a, type, (IComparable)b)); }