Class EnumerationExtensions
- Namespace
- CapyKit.Extensions
- Assembly
- CapyKit.dll
Provides static extentions methods for providing additional functionality for Enum types.
public static class EnumerationExtensions
- Inheritance
-
EnumerationExtensions
- Inherited Members
Methods
GetDescription(Enum)
An Enum extension method that gets a description.
public static string GetDescription(this Enum enumeration)
Parameters
enumerationEnumThe enumeration to act on.
Returns
- string
The description if available, otherwise the string representation of the enumeration.
GetName(Enum)
An Enum extension method that gets a name.
public static string GetName(this Enum enumeration)
Parameters
enumerationEnumThe enumeration to act on.
Returns
- string
The name of the enumeration.
GetPrettyName(Enum)
An Enum extension method that gets a human readable name.
public static string GetPrettyName(this Enum enumeration)
Parameters
enumerationEnumThe enumeration to act on.
Returns
- string
The human readable name of the enumeration.
GetValue(Enum)
An Enum extension method that gets an integer value representing the enumation.
public static int GetValue(this Enum enumeration)
Parameters
enumerationEnumThe enumeration to act on.
Returns
- int
The integer value of the enumeration.
Parse<T>(T, string)
A T extension method that parses a string into an enumeration.
public static T Parse<T>(this T enumeration, string value) where T : Enum
Parameters
enumerationTThe enumeration to act on.
valuestringThe value.
Returns
- T
A T.
Type Parameters
TGeneric type parameter.
Parse<T>(T, string, bool)
A T extension method that parses a string into an enumeration.
public static T Parse<T>(this T enumeration, string value, bool ignoreCase) where T : Enum
Parameters
enumerationTThe enumeration to act on.
valuestringThe string value of the Enum.
ignoreCaseboolTrue to ignore case.
Returns
- T
A T.
Type Parameters
TGeneric type parameter.