Class EnumExtensions
Contains extension methods for Enums.
Inheritance
EnumExtensions
Assembly: NanoByte.Common.dll
Syntax
public static class EnumExtensions : Object
Methods
GetEnumAttribute<TAttribute>(Enum)
Gets the first TAttribute
attribute set on the target
enum value.
Declaration
public static TAttribute GetEnumAttribute<TAttribute>(this Enum target)
where TAttribute : Attribute
Parameters
Type |
Name |
Description |
Enum |
target |
|
Returns
Type |
Description |
TAttribute |
|
Type Parameters
Name |
Description |
TAttribute |
|
HasFlag(Enum, Enum)
Checks whether a flag is set.
Declaration
public static bool HasFlag(this Enum enumRef, Enum flag)
Parameters
Type |
Name |
Description |
Enum |
enumRef |
|
Enum |
flag |
|
Returns
HasFlag(Int32, Int32)
Checks whether a flag is set.
Declaration
public static bool HasFlag(this int enumRef, int flag)
Parameters
Returns
HasFlag(UInt16, UInt16)
Checks whether a flag is set.
Declaration
public static bool HasFlag(this ushort enumRef, ushort flag)
Parameters
Returns