Predicates/SimpleParser/Helpers/ExpressionAutoCast.cs
/// <summary>
/// The Max operator for enumeration types
/// </summary>
/// <typeparam name="T">The enum type</typeparam>
/// <param name="t1">An enum instance</param>
/// <param name="t2">Another enum instance</param>
/// <returns>The maximum (in terms of numeric value) instance</returns>
The Max operator for enumeration types
The Max operator for enumeration types
private static T Max<T>(T t1, T t2) where T : struct, IConvertible
        {
            if (!typeof(T).IsEnum)
            {
                throw new ArgumentException("T must be an enumerated type");
            }
            if (t1.ToInt64(null) >= t2.ToInt64(null))
            {
                return t1;
            }
            return t2;
        }
private static T Max < T > ( T t1 , T t2 ) where T : struct , IConvertible { if ( ! typeof ( T ) . IsEnum ) { throw new ArgumentException ( " " ) ; } if ( t1 . ToInt64 ( null ) >= t2 . ToInt64 ( null ) ) { return t1 ; } return t2 ; }
The Max operator for enumeration types
The Max operator for enumeration types
The maximum (in terms of numeric value) instance
The maximum ( in terms of numeric value ) instance
t1
T
An enum instance
An enum instance
t2
T
Another enum instance
Another enum instance
typeparam
The enum type
The enum type