EnumConverterConvert(ReadOnlySpanChar, CultureInfo, CommandLineArgument) Method

Converts a string span to the enumeration type.

Definition

Namespace: Ookii.CommandLine.Conversion
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 4.2.0+a4d3631e4dcc0970081ed435288efdebc1325f83
C#
public override Object? Convert(
	ReadOnlySpan<char> value,
	CultureInfo culture,
	CommandLineArgument argument
)

Parameters

value  ReadOnlySpanChar
The ReadOnlySpanT containing the string to convert.
culture  CultureInfo
The culture to use for the conversion.
argument  CommandLineArgument
The CommandLineArgument that will use the converted value.

Return Value

Object
An object representing the converted value.

Remarks

This method performs the conversion using the EnumParse(Type, ReadOnlySpanChar, Boolean) method.

Exceptions

CommandLineArgumentException The value was not valid for the enumeration type.

See Also