Class EnumExtensions
Inheritance
EnumExtensions
Assembly: Glitch9.dll
Syntax
public static class EnumExtensions
Methods
|
Edit this page
View Source
HasAnyFlag<T>(T, T?)
Checks if the enum value has any of the specified flags set.
If the flag parameter is null, returns false.
Declaration
public static bool HasAnyFlag<T>(this T value, T? flag) where T : struct, Enum
Parameters
| Type |
Name |
Description |
| T |
value |
|
| T? |
flag |
|
Returns
Type Parameters
|
Edit this page
View Source
ToEnum<TEnum>(int)
Declaration
public static TEnum ToEnum<TEnum>(this int value) where TEnum : struct, Enum
Parameters
| Type |
Name |
Description |
| int |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
ToFlagList<T>(T)
Declaration
public static List<T> ToFlagList<T>(this T value) where T : struct, Enum
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
ToFlagSet<T>(T)
Declaration
public static HashSet<T> ToFlagSet<T>(this T value) where T : struct, Enum
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Type Parameters
|
Edit this page
View Source
ToJoinedString<T>(T, char, char)
Formats a [Flags] enum value to a lowercase joined string.
If the value is the default (zero) value, returns an empty string.
Declaration
public static string ToJoinedString<T>(this T value, char splitSeparator = ',', char joinSeparator = '-') where T : struct, Enum
Parameters
| Type |
Name |
Description |
| T |
value |
|
| char |
splitSeparator |
|
| char |
joinSeparator |
|
Returns
Type Parameters
|
Edit this page
View Source
ToLowerInvariantString<T>(T)
Formats an enum value to a lowercase string.
If the value is the default (zero) value, returns an empty string.
Declaration
public static string ToLowerInvariantString<T>(this T value) where T : struct, Enum
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
Type Parameters