Class DelegateValidator
Implements a validator with an anonymous function
Inheritance
System.Object
DelegateValidator
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public class DelegateValidator : ICommandValidator, IArgumentValidator, IOptionValidator
Constructors
|
Improve this Doc
View Source
DelegateValidator(Func<ValidationContext, ValidationResult>)
Declaration
public DelegateValidator(Func<ValidationContext, ValidationResult> validator)
Parameters
| Type |
Name |
Description |
| System.Func<System.ComponentModel.DataAnnotations.ValidationContext, System.ComponentModel.DataAnnotations.ValidationResult> |
validator |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IArgumentValidator.GetValidationResult(CommandArgument, ValidationContext)
Declaration
ValidationResult IArgumentValidator.GetValidationResult(CommandArgument argument, ValidationContext context)
Parameters
| Type |
Name |
Description |
| CommandArgument |
argument |
|
| System.ComponentModel.DataAnnotations.ValidationContext |
context |
|
Returns
| Type |
Description |
| System.ComponentModel.DataAnnotations.ValidationResult |
|
|
Improve this Doc
View Source
ICommandValidator.GetValidationResult(CommandLineApplication, ValidationContext)
Declaration
ValidationResult ICommandValidator.GetValidationResult(CommandLineApplication command, ValidationContext context)
Parameters
| Type |
Name |
Description |
| CommandLineApplication |
command |
|
| System.ComponentModel.DataAnnotations.ValidationContext |
context |
|
Returns
| Type |
Description |
| System.ComponentModel.DataAnnotations.ValidationResult |
|
|
Improve this Doc
View Source
IOptionValidator.GetValidationResult(CommandOption, ValidationContext)
Declaration
ValidationResult IOptionValidator.GetValidationResult(CommandOption option, ValidationContext context)
Parameters
| Type |
Name |
Description |
| CommandOption |
option |
|
| System.ComponentModel.DataAnnotations.ValidationContext |
context |
|
Returns
| Type |
Description |
| System.ComponentModel.DataAnnotations.ValidationResult |
|
Implements