Requires.Defined<TEnum>(TEnum, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Throws an InvalidEnumArgumentException if a given value is not a named value of the enum type.
public:
generic <typename TEnum>
where TEnum : value class static void Defined(TEnum value, System::String ^ parameterName);
[System.Diagnostics.DebuggerStepThrough]
public static void Defined<TEnum> (TEnum value, string parameterName) where TEnum : struct;
[System.Diagnostics.DebuggerStepThrough]
public static void Defined<TEnum> (TEnum value, string? parameterName = default) where TEnum : struct;
[<System.Diagnostics.DebuggerStepThrough>]
static member Defined : 'Enum * string -> unit (requires 'Enum : struct)
Public Shared Sub Defined(Of TEnum As Structure) (value As TEnum, parameterName As String)
Public Shared Sub Defined(Of TEnum As Structure) (value As TEnum, Optional parameterName As String = Nothing)
Type Parameters
- TEnum
The type of enum that may define the value
.
Parameters
- value
- TEnum
The value that may be named by TEnum
.
- parameterName
- String
The name of the parameter to include in any thrown exception. If this argument is omitted (explicitly writing null
does not qualify), the expression used in the first argument will be used as the parameter name.
- Attributes