BadScript 2
Loading...
Searching...
No Matches
BadScript2.Utility.BadEnum Class Reference

Implements Enum functions that are missing in .NET Standard 2.0. More...

Static Public Member Functions

static T Parse< T > (string value, bool ignoreCase)
 Parses a string to an enum.
 
static T Parse< T > (string value)
 Parses a string to an enum.
 

Detailed Description

Implements Enum functions that are missing in .NET Standard 2.0.

Definition at line 10 of file BadEnum.cs.

Member Function Documentation

◆ Parse< T >() [1/2]

static T BadScript2.Utility.BadEnum.Parse< T > ( string  value)
static

Parses a string to an enum.

Parameters
valueThe String Value
Template Parameters
TEnum Type
Returns
The Enum Value
Type Constraints
T :Enum 

Definition at line 30 of file BadEnum.cs.

30 : Enum
31 {
32 return (T)Enum.Parse(typeof(T), value);
33 }

◆ Parse< T >() [2/2]

static T BadScript2.Utility.BadEnum.Parse< T > ( string  value,
bool  ignoreCase 
)
static

Parses a string to an enum.

Parameters
valueThe String Value
ignoreCaseShould we ignore case?
Template Parameters
TEnum Type
Returns
The Enum Value
Type Constraints
T :Enum 

Definition at line 19 of file BadEnum.cs.

19 : Enum
20 {
21 return (T)Enum.Parse(typeof(T), value, ignoreCase);
22 }

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