C# Class Castle.Components.Validator.LengthValidator

Inheritance: AbstractValidator
Afficher le fichier Open project: nats/castle-1.0.3-mono Class Usage Examples

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
BuildErrorMessage ( ) : string

Builds the error message.

Method Details

ApplyBrowserValidation() public méthode

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.
Résultat void

BuildErrorMessage() protected méthode

Builds the error message.
protected BuildErrorMessage ( ) : string
Résultat string

IsValid() public méthode

Validate that the property value matches the length requirements.
public IsValid ( object instance, object fieldValue ) : bool
instance object
fieldValue object
Résultat bool

LengthValidator() public méthode

Initializes a new exact length validator.
public LengthValidator ( int exactLength ) : System
exactLength int The exact length required.
Résultat System

LengthValidator() public méthode

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.
Résultat System