Class EnumExtensions
Provides generic methods for bitwise operations and validation on enumerations.
Inherited Members
Namespace: Singulink.Enums
Assembly: Singulink.Enums.dll
Syntax
public static class EnumExtensions
Methods
Name | Description |
---|---|
AreFlagsDefined<T>(T) | Determines whether the value's flags are all defined and they are a valid combination of flags. |
AsString<T>(T) | Gets a string representation of the specified enumeration value. |
AsString<T>(T, SplitFlagsOptions) | Gets a string representation of the specified enumeration value using the specified options to customize how flags are split. |
ClearFlags<T>(T, IEnumerable<T>) | Clears the specified flags on the value. |
ClearFlags<T>(T, ReadOnlySpan<T>) | Clears the specified flags on the value. |
ClearFlags<T>(T, T) | Clears the specified flags on the value. |
ClearFlags<T>(T, T, T) | Clears the specified flags on the value. |
ClearFlags<T>(T, T, T, T) | Clears the specified flags on the value. |
ClearFlags<T>(T, params T[]) | Clears the specified flags on the value. |
GetName<T>(T) | Gets the first enumeration name with the given value. |
HasAllFlags<T>(T, IEnumerable<T>) | Determines whether the value has all the given flags. |
HasAllFlags<T>(T, ReadOnlySpan<T>) | Determines whether the value has all the given flags. |
HasAllFlags<T>(T, T) | Determines whether the value has all the given flags. |
HasAllFlags<T>(T, T, T) | Determines whether the value has all the given flags. |
HasAllFlags<T>(T, T, T, T) | Determines whether the value has all the given flags. |
HasAllFlags<T>(T, params T[]) | Determines whether the value has all the given flags. |
HasAnyFlag<T>(T, IEnumerable<T>) | Determines whether the value has any of the given flags. |
HasAnyFlag<T>(T, ReadOnlySpan<T>) | Determines whether the value has any of the given flags. |
HasAnyFlag<T>(T, T) | Determines whether the value has any of the given flags. |
HasAnyFlag<T>(T, T, T) | Determines whether the value has any of the given flags. |
HasAnyFlag<T>(T, T, T, T) | Determines whether the value has any of the given flags. |
HasAnyFlag<T>(T, params T[]) | Determines whether the value has any of the given flags. |
IsDefined<T>(T) | Determines whether the value is defined. |
IsValid<T>(T) | Uses the custom IEnumValidatorAttribute<T> if available to check if the value is valid, otherwise checks whether the value is defined for regular enumerations, or checks whether the value's flags are all defined for flags enumerations. |
SetFlags<T>(T, IEnumerable<T>) | Sets the specified flags on the value. |
SetFlags<T>(T, ReadOnlySpan<T>) | Sets the specified flags on the value. |
SetFlags<T>(T, T) | Sets the specified flags on the value. |
SetFlags<T>(T, T, T) | Sets the specified flags on the value. |
SetFlags<T>(T, T, T, T) | Sets the specified flags on the value. |
SetFlags<T>(T, params T[]) | Sets the specified flags on the value. |
SplitFlags<T>(T, SplitFlagsOptions) | Splits the value into the defined flags that make up the value, plus any remainder (if ExcludeRemainder is not set). |
TryGetName<T>(T, out string?) | Gets the first enumeration name with the given value. |