Chiaki by Steven P

<PackageReference Include="Chiaki" Version="1.0.0" />

 Enum<T>

public static class Enum<T> where T : struct
Provides strongly typed methods for working with Enum.
public static T? CastOrNull(int value)

Attempts to cast the enum integer value into an enum value. If unable to cast, returns null.

public static IEnumerable<T> GetFlags(T flagEnum)

Gets applied flags on an enum instance.

public static string GetName(T value)

Gets the string representation of a specific value in this enum.

public static string[] GetNames()

Gets string representations of each value in this enum.

public static IEnumerable<T> GetValues()

Gets all possible enum values in this enum.

public static bool IsDefined(T value)

Gets whether or not the object provided is a valid entry in this enum.

public static bool IsDefined(string value)

Gets whether or not the string value provided is a valid entry in this enum.

public static bool IsDefined(int value)

Gets whether or not the integer value provided is a valid value within this enum.

public static T Parse(string value)

Parses the string value into a enum.

public static T Parse(string value, bool ignoreCase)

Parses the string value into a enum, and allows you to specify whether to ignore casing.

public static T? ParseOrNull(string value)

Parses the string value into a nullable enum. If unable to parse, will return null.

public static T? ParseOrNull(string value, bool ignoreCase)

Parses the string value into a nullable enum, with the option to ignore casing. If unable to parse, will return null.

public static T SetFlags(IEnumerable<T> flags)

Sets applied flags on an enum instance.

public static bool TryParse(string value, out T returnValue)

Tries to parses a specific enum value from a string.

public static bool TryParse(string value, bool ignoreCase, out T returnValue)

Tries to parses a specific enum value from a string, and allows you to specify whether to ignore casing.