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