Provides conversion between enum value and primitive types.
InheritanceEnumConverter
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic static class EnumConverter
Methods | Edit this page View Source
Converts enum value to numeric value.
Declaration[CLSCompliant(false)]
public static TValue FromEnum<TEnum, TValue>(TEnum value) where TEnum : struct, Enum where TValue : unmanaged, INumberBase<TValue>, IConvertible
Parameters Type Name Description TEnum value
The enum value to convert.
Returns Type Description TValueThe numeric equivalent of value
.
The type of the enum.
TValueThe type of numeric value.
| Edit this page View Source GetTypeCode<TEnum>()Gets underlying type of the enum.
Declarationpublic static TypeCode GetTypeCode<TEnum>() where TEnum : struct, Enum
Returns Type Description TypeCode
The underlying type of TEnum
.
The type of the enum.
| Edit this page View Source ToEnum<TEnum, TValue>(TValue)Converts a value of type TValue
to enum of type TEnum
.
[CLSCompliant(false)]
public static TEnum ToEnum<TEnum, TValue>(TValue value) where TEnum : struct, Enum where TValue : unmanaged, INumberBase<TValue>, IConvertible
Parameters Type Name Description TValue value
The value to be converted.
Returns Type Description TEnumThe enum value that is equivalent to TEnum
.
The type of the enum.
TValueThe numeric type representing enum value.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4