Class IPAddressValidator
- Namespace
- CloudyWing.FormValidators
- Assembly
- CloudyWing.FormValidators.dll
The IP address validator.
public sealed class IPAddressValidator : FormValidatorBase, IFormValidator
- Inheritance
-
IPAddressValidator
- Implements
- Inherited Members
Constructors
IPAddressValidator(string, string, IPAddressTypes, Func<string, string, IPAddressTypes, string>)
Initializes a new instance of the IPAddressValidator class.
public IPAddressValidator(string column, string value, IPAddressTypes types, Func<string, string, IPAddressTypes, string> customErrorMessageAccessor = null)
Parameters
columnstringThe column.
valuestringThe value.
typesIPAddressTypesThe types.
customErrorMessageAccessorFunc<string, string, IPAddressTypes, string>The custom error message accessor. The arguments are column, value, IP address types.
IPAddressValidator(string, string, Func<string, string, IPAddressTypes, string>)
Initializes a new instance of the IPAddressValidator class.
public IPAddressValidator(string column, string value, Func<string, string, IPAddressTypes, string> customErrorMessageAccessor = null)
Parameters
columnstringThe column.
valuestringThe value.
customErrorMessageAccessorFunc<string, string, IPAddressTypes, string>The custom error message accessor. The arguments are column, value, IP address types.
Properties
CustomErrorMessage
Gets the custom error message.
protected override string CustomErrorMessage { get; }
Property Value
- string
The custom error message.
CustomErrorMessageAccessor
Gets or sets the custom error message accessor.
public Func<string, string, IPAddressTypes, string> CustomErrorMessageAccessor { get; }
Property Value
- Func<string, string, IPAddressTypes, string>
The custom error message accessor.
DefaultErrorMessage
Gets the default error message.
protected override string DefaultErrorMessage { get; }
Property Value
- string
The default error message.
HasCustomErrorMessage
Gets a value indicating whether this instance has custom error message.
protected override bool HasCustomErrorMessage { get; }
Property Value
- bool
trueif this instance has custom error message; otherwise,false.
Types
Gets the types.
public IPAddressTypes Types { get; }
Property Value
- IPAddressTypes
The types.
Methods
ValidateValue()
Validates the value.
protected override bool ValidateValue()
Returns
- bool
The validation result.