Class DelegateValidator
Implements a validator with an anonymous function
Inheritance
System.Object
DelegateValidator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: McMaster.Extensions.CommandLineUtils.Validation
Assembly: McMaster.Extensions.CommandLineUtils.dll
Syntax
public class DelegateValidator : ICommandValidator, IArgumentValidator, IOptionValidator
Constructors
| Improve this Doc View SourceDelegateValidator(Func<ValidationContext, ValidationResult>)
Initializes an instance of DelegateValidator.
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 SourceIArgumentValidator.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 |
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 |
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 |