EnumExtensions¶
Namespace:
SideXP.Core
Extension functions for enum values.
Methods¶
IsValid<TEnum>(TEnum)¶
Checks if the given enumeration value matches an item.
Type parameters
TEnum: The enumeration type.
Parameters
enumValue: The enumeration value to check.
Returns
Returns true if the given enumeration value matches an item.
Invert<TEnum>(TEnum)¶
Invert the given enumeration value: enabled flags become disabled flags, and vice-versa.
Type parameters
TEnum: The enumeration type.
Parameters
enumValue: The enumeration value to invert.
AddFlag<TEnum>(TEnum, TEnum)¶
Adds the given flag to the enum value.
Type parameters
TEnum: The enumeration type.
Parameters
enumValue: The enumeration value to which you want to add the flag.flag: The flag to add.
RemoveFlag<TEnum>(TEnum, TEnum)¶
Removes the given flag from the enum value.
Type parameters
TEnum: The enumeration type.
Parameters
enumValue: The enumeration value from which you want to remove the flag.flag: The flag to remove.