C# Client Library
A C# Client Library for the AnalyzeRe REST API
Loading...
Searching...
No Matches
AnalyzeRe.Utilities.Enum< T > Class Template Reference

Helper class for extending the functionality of the static

See also
Enum

class with compile-time-type-specific static methods. More...

Static Public Member Functions

static string GetName (T value)
 Convert the enumeration value to a string.
 
static T Parse (string value)
 Convert the string to an enumeration value.
 
static bool TryParse (string value, out T result)
 Try to convert the string to an enumeration value.
 

Properties

static IEnumerable< string > Names [get]
 Get all names in an enumeration.
 
static IEnumerable< T > Values [get]
 Get all values in an enumeration.
 

Detailed Description

Helper class for extending the functionality of the static

See also
Enum

class with compile-time-type-specific static methods.

Type Constraints
T :struct 
T :IComparable 
T :IFormattable 
T :IConvertible 

Definition at line 10 of file Enum.cs.

Member Function Documentation

◆ GetName()

static string AnalyzeRe.Utilities.Enum< T >.GetName ( value)
static

Convert the enumeration value to a string.

The uses a cached dictionary of names, so it is faster than the Enum.GetName implementation, but not as fast as creating a custom switch statement for a given enum.

◆ Parse()

static T AnalyzeRe.Utilities.Enum< T >.Parse ( string  value)
static

Convert the string to an enumeration value.

Uses case-insensitive parsing rules.

◆ TryParse()

static bool AnalyzeRe.Utilities.Enum< T >.TryParse ( string  value,
out T  result 
)
static

Try to convert the string to an enumeration value.

Uses case-insensitive parsing rules.

Property Documentation

◆ Names

IEnumerable<string> AnalyzeRe.Utilities.Enum< T >.Names
staticget

Get all names in an enumeration.

Definition at line 24 of file Enum.cs.

◆ Values

IEnumerable<T> AnalyzeRe.Utilities.Enum< T >.Values
staticget

Get all values in an enumeration.

Definition at line 17 of file Enum.cs.


The documentation for this class was generated from the following file: