View Source
Class Enum<T>
Provides utility methods for handling enumerations.
Assembly: Umbraco.Core.dll
Syntax
public static class Enum<T> where T : struct
Type Parameters
Methods
View Source
CastOrNull(int)
Declaration
public static T? CastOrNull(int value)
Parameters
| Type |
Name |
Description |
| int |
value |
|
Returns
View Source
GetName(T)
Declaration
public static string? GetName(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
View Source
GetNames()
Declaration
public static string[] GetNames()
Returns
| Type |
Description |
| string[] |
|
View Source
GetValues()
Declaration
public static IEnumerable<T> GetValues()
Returns
| Type |
Description |
| IEnumerable<T> |
|
View Source
IsDefined(int)
Declaration
public static bool IsDefined(int value)
Parameters
| Type |
Name |
Description |
| int |
value |
|
Returns
View Source
IsDefined(string)
Declaration
public static bool IsDefined(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
Returns
View Source
IsDefined(T)
Declaration
public static bool IsDefined(T value)
Parameters
| Type |
Name |
Description |
| T |
value |
|
Returns
View Source
Parse(string, bool)
Declaration
public static T Parse(string value, bool ignoreCase = false)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| bool |
ignoreCase |
|
Returns
View Source
ParseOrNull(string)
Declaration
public static T? ParseOrNull(string value)
Parameters
| Type |
Name |
Description |
| string |
value |
|
Returns
View Source
TryParse(string, out T, bool)
Declaration
public static bool TryParse(string value, out T returnValue, bool ignoreCase = false)
Parameters
| Type |
Name |
Description |
| string |
value |
|
| T |
returnValue |
|
| bool |
ignoreCase |
|
Returns