Table of Contents

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
object
Attribute
ValidationAttribute
LegalFilePathAttribute

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

value object

The value to validate.

validationContext ValidationContext

The 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.