C# Класс Castle.Components.Validator.LengthValidator

Наследование: AbstractValidator
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ApplyBrowserValidation ( BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, IDictionary attributes, string target ) : void

Applies the browser validation by setting up one or more input rules on IBrowserValidationGenerator.

IsValid ( object instance, object fieldValue ) : bool

Validate that the property value matches the length requirements.

LengthValidator ( int exactLength ) : System

Initializes a new exact length validator.

LengthValidator ( int minLength, int maxLength ) : System

Initializes a new range based length validator.

Защищенные методы

Метод Описание
BuildErrorMessage ( ) : string

Builds the error message.

Описание методов

ApplyBrowserValidation() публичный Метод

Applies the browser validation by setting up one or more input rules on IBrowserValidationGenerator.
public ApplyBrowserValidation ( BrowserValidationConfiguration config, InputElementType inputType, IBrowserValidationGenerator generator, IDictionary attributes, string target ) : void
config BrowserValidationConfiguration The config.
inputType InputElementType Type of the input.
generator IBrowserValidationGenerator The generator.
attributes IDictionary The attributes.
target string The target.
Результат void

BuildErrorMessage() защищенный Метод

Builds the error message.
protected BuildErrorMessage ( ) : string
Результат string

IsValid() публичный Метод

Validate that the property value matches the length requirements.
public IsValid ( object instance, object fieldValue ) : bool
instance object
fieldValue object
Результат bool

LengthValidator() публичный Метод

Initializes a new exact length validator.
public LengthValidator ( int exactLength ) : System
exactLength int The exact length required.
Результат System

LengthValidator() публичный Метод

Initializes a new range based length validator.
public LengthValidator ( int minLength, int maxLength ) : System
minLength int The minimum length, or int.MinValue if this should not be tested.
maxLength int The maximum length, or int.MaxValue if this should not be tested.
Результат System