File System File System
File System File System
DocFX + Singulink = ♥

Search Results for

    Class ValidPathAttribute

    Specifies that a path property, field or parameter must be valid for the specified path options, as determined by IsValidFor(PathOptions, out string?).

    Inheritance
    object
    Attribute
    ValidationAttribute
    ValidPathAttribute
    Inherited Members
    ValidationAttribute.GetValidationResult(object, ValidationContext)
    ValidationAttribute.Validate(object, ValidationContext)
    ValidationAttribute.Validate(object, string)
    ValidationAttribute.ErrorMessage
    ValidationAttribute.ErrorMessageResourceName
    ValidationAttribute.ErrorMessageResourceType
    ValidationAttribute.RequiresValidationContext
    Attribute.Equals(object)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetHashCode()
    Attribute.IsDefaultAttribute()
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.Match(object)
    Attribute.TypeId
    Namespace: Singulink.IO
    Assembly: Singulink.IO.FileSystem.dll
    Syntax
    [AttributeUsage(AttributeTargets.Property|AttributeTargets.Field|AttributeTargets.Parameter, AllowMultiple = false)]
    public sealed class ValidPathAttribute : ValidationAttribute
    Remarks

    The attribute checks IPath values. A null value is valid; RequiredAttribute is what requires a value. A value of any other type, including a string, is invalid and isn't parsed.

    The default error message is "The {0} field is not a valid path. {1}", where {0} is the display name of the member and {1} is the reason: the error message that parsing the path with the options gives (e.g. "Entry name ends with a space."), or for a value that isn't a path, its type (e.g. "Value of type String is not a path."). {1} is empty in FormatErrorMessage(string), which has no value to give a reason for. ErrorMessage, or ErrorMessageResourceType and ErrorMessageResourceName, replace the message and can use the same placeholders.

    Constructors

    Name Description
    ValidPathAttribute(PathOptions)

    Specifies that a path property, field or parameter must be valid for the specified path options, as determined by IsValidFor(PathOptions, out string?).

    Properties

    Name Description
    Options

    Gets the path options the path must be valid for.

    Methods

    Name Description
    FormatErrorMessage(string)

    Applies formatting to an error message, based on the data field where the error occurred.

    IsValid(object?)

    Determines whether the specified value of the object is valid.

    IsValid(object?, ValidationContext)

    Validates the specified value with respect to the current validation attribute.

    © Singulink. All rights reserved.