EnumUtils Class

Version 1.1.28
.NET Framework 4.8
Namespace Skybrud.Essentials.Enums
Assembly Skybrud.Essentials.dll
Visibility Public
Keywords Static
Inheritance Object

Utility class with various static helper methods for working with enums.

public static class EnumUtils { }

Methods

Converts the specified input value to a anum of type T.

Gets an array of all values of the specified enum class T.

Gets an array of all values of the specified enum type.

IsEnum<T>() (static)

Returns whether T is an enum.

IsEnum(Type) (static)

Returns whether the specified type is an enum.

Max<T>(T, T) (static)

Returns the maximum value of the enum values a and b.

Max<T>(T[]) (static)

Returns the maximum value of the specified enum values.

Min<T>(T, T) (static)

Returns the minimum value of the enum values a and b.

Min<T>(T[]) (static)

Returns the minimum value of the specified enum values.

Parses the specified str into the enum of type T. If str cannot be parsed, an exception of type EnumParseException will be thrown instead.

Converts the specified str into an instance of enumType.

Parses the specified str into the enum of type T. If str cannot be parsed, the value fallback will be returned instead.

Converts the specified str into an array of T.

Converts the specified str into an array of type.

Converts the specified str into an array of type.

Converts the specified array of pieces into an array of type.

Converts the string representation of the name or numeric value to an enum of type T. The return value indicates whether the conversion succeeded.

Converts the string representation of the name or numeric value to an enum of the specified type. The return value indicates whether the conversion succeeded.