ArgumentConverterConvert Method

Converts a string memory region to the type of the argument.

Definition

Namespace: Ookii.CommandLine.Conversion
Assembly: Ookii.CommandLine (in Ookii.CommandLine.dll) Version: 5.0.0+724ca9b7fa5edc075ec2ae65044e61b0d494fd1c
C#
public abstract Object? Convert(
	ReadOnlyMemory<char> value,
	CultureInfo culture,
	CommandLineArgument argument
)

Parameters

value  ReadOnlyMemoryChar
The ReadOnlyMemoryT 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.

Exceptions

ArgumentNullExceptionculture or argument is .
FormatException The value was not in a correct format for the target type.
OverflowException The value was out of range for the target type.
CommandLineArgumentException The value was not in a correct format for the target type. Unlike other exceptions, which will be wrapped in a CommandLineArgumentException, a CommandLineArgumentException thrown by this method will be passed down to the user unmodified.

See Also