C# Class ExoRule.Validation.PropertyRule

Abstract base for simple validation rules for properties in a model.
Inheritance: Rule, IPropertyRule
Afficher le fichier Open project: vc3/ExoRule

Private Properties

Свойство Type Description
PropertyRule System

Méthodes publiques

Méthode Description
PropertyRule ( string rootType, string property, ConditionType conditionType, RuleInvocationType invocationTypes ) : System

Creates a new PropertyRule for the specified property and condition type.

PropertyRule ( string rootType, string property, ConditionType>.Func conditionType, RuleInvocationType invocationTypes ) : System

Creates a new PropertyRule for the specified property and condition type.

Méthodes protégées

Méthode Description
ConditionApplies ( ModelInstance root ) : bool

Overridden in subclasses to determine if the ConditionType applies.

Format ( ModelType rootType, string property, object value ) : string

Formats the specified value based on the formatting associated with the specified property.

GetErrorCode ( string rootType, string property, string rule ) : string

Generates a unique error code for a property-specific rule.

GetLabel ( ModelType rootType, string property ) : string

Gets the label for the specified property.

GetSourceLabel ( ModelType rootType, string source ) : string

Gets the label for the specified source property path.

InitializePredicates ( ) : void

Initializes predicates for the specified property rule which leverages a comparison property.

OnInvoke ( ModelInstance root, ModelEvent modelEvent ) : void
PropertyRule ( string rootType, string property, RuleInvocationType invocationTypes ) : System

Private Methods

Méthode Description
PropertyRule ( ) : System

Register resources for validation rule subclasses.

Method Details

ConditionApplies() protected abstract méthode

Overridden in subclasses to determine if the ConditionType applies.
protected abstract ConditionApplies ( ModelInstance root ) : bool
root ModelInstance
Résultat bool

Format() protected static méthode

Formats the specified value based on the formatting associated with the specified property.
protected static Format ( ModelType rootType, string property, object value ) : string
rootType ModelType
property string
value object
Résultat string

GetErrorCode() protected static méthode

Generates a unique error code for a property-specific rule.
protected static GetErrorCode ( string rootType, string property, string rule ) : string
rootType string
property string
rule string
Résultat string

GetLabel() protected static méthode

Gets the label for the specified property.
protected static GetLabel ( ModelType rootType, string property ) : string
rootType ModelType
property string
Résultat string

GetSourceLabel() protected static méthode

Gets the label for the specified source property path.
protected static GetSourceLabel ( ModelType rootType, string source ) : string
rootType ModelType
source string
Résultat string

InitializePredicates() protected méthode

Initializes predicates for the specified property rule which leverages a comparison property.
protected InitializePredicates ( ) : void
Résultat void

OnInvoke() protected méthode

protected OnInvoke ( ModelInstance root, ModelEvent modelEvent ) : void
root ModelInstance
modelEvent ExoModel.ModelEvent
Résultat void

PropertyRule() public méthode

Creates a new PropertyRule for the specified property and condition type.
public PropertyRule ( string rootType, string property, ConditionType conditionType, RuleInvocationType invocationTypes ) : System
rootType string
property string
conditionType ConditionType
invocationTypes RuleInvocationType
Résultat System

PropertyRule() public méthode

Creates a new PropertyRule for the specified property and condition type.
public PropertyRule ( string rootType, string property, ConditionType>.Func conditionType, RuleInvocationType invocationTypes ) : System
rootType string
property string
conditionType ConditionType>.Func
invocationTypes RuleInvocationType
Résultat System

PropertyRule() protected méthode

protected PropertyRule ( string rootType, string property, RuleInvocationType invocationTypes ) : System
rootType string
property string
invocationTypes RuleInvocationType
Résultat System