Пример #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);
Пример #2
0
 public static TEnum[] GetValues <TEnum>()
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(false).Values.ToArray();
Пример #3
0
 public static bool IsDefined <TEnum>(TEnum value)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .IsDefined(value);
Пример #4
0
 public static IReadOnlyDictionary <string, TEnum> GetNameValues <TEnum>(bool ignoreCase = false)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(ignoreCase);
Пример #5
0
 public static string[] GetNames <TEnum>(bool ignoreCase = false)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .GetNameValues(ignoreCase).Keys.ToArray();
Пример #6
0
 public static TEnum ClearFlag <TEnum>(this TEnum value, TEnum flag)
     where TEnum : struct, Enum =>
 Holder <TEnum> .ClearFlagCallback(value, flag);
Пример #7
0
 public static TEnum ClearFlag <TEnum>(this TEnum value, TEnum flag)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .ClearFlagCallback(value, flag);
Пример #8
0
 public static bool AreFlagsDefined <TEnum>(TEnum flags)
     where TEnum : struct, Enum =>
 Holder <TEnum> .AreFlagsDefined(flags);
Пример #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);
Пример #10
0
 public static bool IsDefined <TEnum>(TEnum value)
     where TEnum : struct, Enum =>
 Holder <TEnum> .IsDefined(value);
Пример #11
0
 public static bool IsDefined <TEnum>([NotNull] string value)
     where TEnum : struct, Enum =>
 TryParse <TEnum>(value, out var parsed) && Holder <TEnum> .IsDefined(parsed);
Пример #12
0
 public static TEnum[] GetValues <TEnum>()
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(false).Values.ToArray();
Пример #13
0
 public static string[] GetNames <TEnum>(bool ignoreCase = false)
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(ignoreCase).Keys.ToArray();
Пример #14
0
 public static IReadOnlyDictionary <string, TEnum> GetNameValues <TEnum>(bool ignoreCase = false)
     where TEnum : struct, Enum =>
 Holder <TEnum> .GetNameValues(ignoreCase);
Пример #15
0
 public static bool AreFlagsDefined <TEnum>(TEnum flags)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 Holder <TEnum> .AreFlagsDefined(flags);
Пример #16
0
 public static bool IsFlagUnset <TEnum>(this TEnum value, TEnum flags)
     where TEnum : struct, IComparable, IFormattable, IConvertible =>
 !Holder <TEnum> .IsAnyFlagSetCallback(value, flags);
Пример #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);
Пример #18
0
 public static bool IsFlagUnset <TEnum>(this TEnum value, TEnum flags)
     where TEnum : struct, Enum =>
 !Holder <TEnum> .IsAnyFlagSetCallback(value, flags);