Class EnumerationExtensions
Extension methods to make working with Enum values easier. Copied from http://hugoware.net/blog/enumeration-extensions-2-0.
Inheritance
System.Object
EnumerationExtensions
Namespace: System
Assembly: PnP.Framework.dll
Syntax
public static class EnumerationExtensions : object
Methods
Has<T>(Enum, T)
Checks if an enumerated type contains a value
Declaration
public static bool Has<T>(this Enum value, T check)
Parameters
Enum
value
Enum value |
T
check
Generic type parameter |
Returns
System.Boolean
Returns true if condition matches and enumerated type contains value |
Type Parameters
T
Generic type |
Include<T>(Enum, T)
Includes an enumerated type and returns the new value
Declaration
public static T Include<T>(this Enum value, T append)
Parameters
Enum
value
Enum value |
T
append
Generic type parameter |
Returns
T
Returns new value |
Type Parameters
T
Generic type |
Missing<T>(Enum, T)
Checks if an enumerated type is missing a value
Declaration
public static bool Missing<T>(this Enum obj, T value)
Parameters
Enum
obj
Enum object |
T
value
Generic type parameter |
Returns
System.Boolean
Returns true if enumerated type is missing a value |
Type Parameters
T
Generic type |
Remove<T>(Enum, T)
Removes an enumerated type and returns the new value
Declaration
public static T Remove<T>(this Enum value, T remove)
Parameters
Enum
value
Enum value |
T
remove
Generic type parameter |
Returns
T
Returns new value |
Type Parameters
T
Generic type |