C# Class Castle.Components.Validator.LengthValidator

Inheritance: AbstractValidator
Show file Open project: nats/castle-1.0.3-mono Class Usage Examples

Public Methods

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

Protected Methods

Method Description
BuildErrorMessage ( ) : string

Builds the error message.

Method Details

ApplyBrowserValidation() public method

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.
return void

BuildErrorMessage() protected method

Builds the error message.
protected BuildErrorMessage ( ) : string
return string

IsValid() public method

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

LengthValidator() public method

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

LengthValidator() public method

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.
return System