Exemple #1
0
 /// <summary>
 /// Returns an indication whether a constant with a specified value exists in a specified enumeration.
 /// </summary>
 /// <param name="value"></param>
 /// <typeparam name="T">Enum type</typeparam>
 /// <returns></returns>
 public static bool IsDefined <T>(int value)
     where T : struct, Enum
 {
     if (Cache_UnderlyingOperation <T> .UnderlyingType == typeof(int))
     {
         return(Int32Operation <T> .IsDefined(ref value));
     }
     throw new ArgumentException(IsDefinedTypeMismatchMessage);
 }