Class LegalFilePathAttribute
- Namespace
- McMaster.Extensions.CommandLineUtils
- Assembly
- McMaster.Extensions.CommandLineUtils.dll
Specifies that a value must be a legal file path.
[AttributeUsage(AttributeTargets.Property)]
public sealed class LegalFilePathAttribute : ValidationAttribute
- Inheritance
-
objectAttributeValidationAttributeLegalFilePathAttribute
Constructors
LegalFilePathAttribute()
Initializes an instance of LegalFilePathAttribute.
public LegalFilePathAttribute()
Methods
IsValid(object?, ValidationContext)
Validates the specified value with respect to the current validation attribute.
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
Parameters
valueobjectThe value to validate.
validationContextValidationContextThe context information about the validation operation.
Returns
- ValidationResult
An instance of the ValidationResult class.
Exceptions
- InvalidOperationException
The current attribute is malformed.
- NotImplementedException
IsValid(object, ValidationContext) has not been implemented by a derived class.