C# Class PetShop.Business.Validation.ValidationRules

Afficher le fichier Open project: netTiers/netTiers

Private Properties

Свойство Type Description
GetPropertyRules List
ValidateRuleList void
ValidationRules System

Méthodes publiques

Méthode Description
AddRule ( ValidationRuleHandler handler, ValidationRuleArgs args ) : void

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

AddRule ( ValidationRuleHandler handler, string propertyName ) : void

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

Clear ( ) : void

Clear the rules list.

GetBrokenRules ( ) : BrokenRulesList

Return a BrokenRulesList that contains all of the invalid rules.

ValidateRules ( ) : void

Validate all the rules for all properties.

ValidateRules ( string propertyName ) : void

Validates all rules for a property

Private Methods

Méthode Description
GetPropertyRules ( string propertyName ) : List

Returns a list of ValidationRuleInfo objects for a specified property.

ValidateRuleList ( List ruleList ) : void

Validates a list of rules.

This method calls the Invoke method on each rule in the list. If the rule fails, it is added to the BrokenRulesList

ValidationRules ( object businessEntity ) : System

Creates an instance of the class and associates the target.

Method Details

AddRule() public méthode

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

public AddRule ( ValidationRuleHandler handler, ValidationRuleArgs args ) : void
handler ValidationRuleHandler The method that implements the rule.
args ValidationRuleArgs /// A object specifying the property name and other arguments /// passed to the rule method ///
Résultat void

AddRule() public méthode

Adds a rule to the list of validated rules.

A rule is implemented by a method which conforms to the method signature defined by the ValidationRuleHandler delegate.

public AddRule ( ValidationRuleHandler handler, string propertyName ) : void
handler ValidationRuleHandler The method that implements the rule.
propertyName string /// The name of the property on the target object where the rule implementation can retrieve /// the value to be validated. ///
Résultat void

Clear() public méthode

Clear the rules list.
public Clear ( ) : void
Résultat void

GetBrokenRules() public méthode

Return a BrokenRulesList that contains all of the invalid rules.
public GetBrokenRules ( ) : BrokenRulesList
Résultat BrokenRulesList

ValidateRules() public méthode

Validate all the rules for all properties.
public ValidateRules ( ) : void
Résultat void

ValidateRules() public méthode

Validates all rules for a property
public ValidateRules ( string propertyName ) : void
propertyName string Name of the property to validate.
Résultat void