Example #1
0
 /// <summary>
 /// Returns true if <paramref name="valLeft"/> equals to <paramref name="valRight"/>
 /// </summary>
 public static bool IntersectsWith <T>(this T valLeft, T valRight)
     where T : struct
 {
     return((EnumConverter <T> .ConvertBack(valLeft) & EnumConverter <T> .ConvertBack(valRight)) > 1);
 }
Example #2
0
 /// <summary>
 /// Converts enum value to int
 /// </summary>
 public static int ToInt <T>(this T val)
     where T : struct
 {
     return(EnumConverter <T> .ConvertBack(val));
 }
Example #3
0
 /// <summary>
 /// Returns true if <paramref name="valLeft"/> equals to <paramref name="valRight"/>
 /// </summary>
 public static bool EqualsTo <T>(this T valLeft, T valRight)
     where T : struct
 {
     //default value is defined as 1 (Undefined)
     return(EnumConverter <T> .ConvertBack(valLeft) == EnumConverter <T> .ConvertBack(valRight));
 }