public override bool IsValid(
CommandLineArgument argument,
Object? value
)
Public Overrides Function IsValid (
argument As CommandLineArgument,
value As Object
) As Boolean
Dim instance As ValidateEnumValueAttribute
Dim argument As CommandLineArgument
Dim value As Object
Dim returnValue As Boolean
returnValue = instance.IsValid(argument,
value)
public:
virtual bool IsValid(
CommandLineArgument^ argument,
Object^ value
) override
If the Mode property is ValidationMode.BeforeConversion, the value parameter will be the raw string value provided by the user on the command line.
If the Mode property is ValidationMode.AfterConversion, for regular arguments, the value parameter will be identical to the CommandLineArgument.Value property. For multi-value or dictionary arguments, the value parameter will be equal to the last value added to the collection or dictionary.
If the Mode property is ValidationMode.AfterParsing, value will always be null. Use the CommandLineArgument.Value property instead.
If you need to check the type of the argument, use the CommandLineArgument.ElementType property unless you want to get the collection type for a multi-value or dictionary argument.
NotSupportedException | argument is not an argument with an enumeration type. |