Exemple #1
0
 public static bool IsDefined <TEnum>([NotNull] string value)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 TryParse <TEnum>(value, out var parsed) && Holder <TEnum> .IsDefined(parsed);
Exemple #2
0
 public static TEnum[] GetValues <TEnum>()
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(false).Values.ToArray();
Exemple #3
0
 public static bool IsDefined <TEnum>(TEnum value)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .IsDefined(value);
Exemple #4
0
 public static IReadOnlyDictionary <string, TEnum> GetNameValues <TEnum>(bool ignoreCase = false)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(ignoreCase);
Exemple #5
0
 public static string[] GetNames <TEnum>(bool ignoreCase = false)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(ignoreCase).Keys.ToArray();
Exemple #6
0
 public static TEnum ClearFlag <TEnum>(this TEnum value, TEnum flag)
     where TEnum : struct, Enum =>
 Holder <TEnum> .ClearFlagCallback(value, flag);
Exemple #7
0
 public static TEnum ClearFlag <TEnum>(this TEnum value, TEnum flag)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .ClearFlagCallback(value, flag);
Exemple #8
0
 public static bool AreFlagsDefined <TEnum>(TEnum flags)
     where TEnum : struct, Enum =>
 Holder <TEnum> .AreFlagsDefined(flags);
Exemple #9
0
 public static bool TryParse <TEnum>([NotNull] string name, bool ignoreCase, out TEnum result)
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(ignoreCase).TryGetValue(name, out result) ||
 EnumEx.TryParse(name, ignoreCase, out result);
Exemple #10
0
 public static bool IsDefined <TEnum>(TEnum value)
     where TEnum : struct, Enum =>
 Holder <TEnum> .IsDefined(value);
Exemple #11
0
 public static bool IsDefined <TEnum>([NotNull] string value)
     where TEnum : struct, Enum =>
 TryParse <TEnum>(value, out var parsed) && Holder <TEnum> .IsDefined(parsed);
Exemple #12
0
 public static TEnum[] GetValues <TEnum>()
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(false).Values.ToArray();
Exemple #13
0
 public static string[] GetNames <TEnum>(bool ignoreCase = false)
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(ignoreCase).Keys.ToArray();
Exemple #14
0
 public static IReadOnlyDictionary <string, TEnum> GetNameValues <TEnum>(bool ignoreCase = false)
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(ignoreCase);
Exemple #15
0
 public static bool AreFlagsDefined <TEnum>(TEnum flags)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .AreFlagsDefined(flags);
Exemple #16
0
 public static bool IsFlagUnset <TEnum>(this TEnum value, TEnum flags)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 !Holder <TEnum> .IsAnyFlagSetCallback(value, flags);
Exemple #17
0
 public static bool TryParse <TEnum>([NotNull] string name, bool ignoreCase, out TEnum result)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(ignoreCase).TryGetValue(name, out result) ||
 EnumTargetingHelpers.TryParse(name, ignoreCase, out result);
Exemple #18
0
 public static bool IsFlagUnset <TEnum>(this TEnum value, TEnum flags)
     where TEnum : struct, Enum =>
 !Holder <TEnum> .IsAnyFlagSetCallback(value, flags);