Class EnumCache
Helper class for quicker enum type queries. The result obtained from reflection is cached locally making subsequent queries faster.
Inherited Members
Namespace: LobsterFramework
Assembly: LobsterFramework.dll
Syntax
public static class EnumCache
Methods
| Improve this Doc View SourceGetNames(Type)
Finds the names of an enum type
Declaration
public static ReadOnlyCollection<string> GetNames(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
ReadOnlyCollection<string> | A collection of names of the enum entries, null if the argument is not an enum type |
GetNames<T>()
Finds the names of an enum type
Declaration
public static ReadOnlyCollection<string> GetNames<T>() where T : Enum
Returns
Type | Description |
---|---|
ReadOnlyCollection<string> | A collection of names of the enum entries |
Type Parameters
Name | Description |
---|---|
T | The enum type to be inspected |
GetSize(Type)
Finds the number of entries for the given enum type
Declaration
public static int GetSize(Type type)
Parameters
Type | Name | Description |
---|---|---|
Type | type |
Returns
Type | Description |
---|---|
int | The number of entries of the enum type, 0 if the type is not an enum type |
GetSize<T>()
Finds the number of entries for the given enum type
Declaration
public static int GetSize<T>() where T : Enum
Returns
Type | Description |
---|---|
int |
Type Parameters
Name | Description |
---|---|
T | The enum type to be inspected |