C# 클래스 HandCoded.Validation.RuleSet

A RuleSet instance contains a collection of validation rules that can be tested against a XmlDocument in a single operation.
상속: Validator
파일 보기 프로젝트 열기: formicary/fpml-toolkit-csharp 1 사용 예제들

공개 메소드들

메소드 설명
Add ( Rule rule ) : void

Adds the indicated Rule instance to the RuleSet A Rule may be referenced by several RuleSet instances simultaneously.

If the Rule has the same name as a previously added one then it will replace it. This feature can be used to overwrite standard rules with customized ones.

Add ( RuleSet ruleSet ) : void

Adds the Rule instances that comprise another RuleSet to this one.

ForName ( string name ) : RuleSet

Returns a reference to the named RuleSet instance if it exists.

Remove ( Rule rule ) : Rule

Attempts to remove a given Rule from the collection held by the RuleSet.

Remove ( string name ) : Rule

Attempts to remove a Rule with the given name from the collection held by the RuleSet.

RuleSet ( string name ) : System

Constructs a named empty RuleSet.

보호된 메소드들

메소드 설명
Validate ( NodeIndex nodeIndex, ValidationErrorHandler errorHandler ) : bool

Determines if the XmlDocument instance indexed by the provided NodeIndex has business data content that passes a validation test. If errors are detected they will be reported through the ValidationErrorHandler delegate passed as an argument.

Note that test returns true if it does not fail, including circumstances when the test is inapplicable to the XmlDocument under examination.

비공개 메소드들

메소드 설명
ParseRuleSets ( string uri ) : void

Parse the RuleSet definitions in the configuration file indicated by the URI.

RuleSet ( ) : System

Causes the RuleSet class to try and bootstrap the business rules from a configuration file.

메소드 상세

Add() 공개 메소드

Adds the indicated Rule instance to the RuleSet A Rule may be referenced by several RuleSet instances simultaneously.

If the Rule has the same name as a previously added one then it will replace it. This feature can be used to overwrite standard rules with customized ones.

public Add ( Rule rule ) : void
rule Rule The to be added.
리턴 void

Add() 공개 메소드

Adds the Rule instances that comprise another RuleSet to this one.
public Add ( RuleSet ruleSet ) : void
ruleSet RuleSet The RuleSet to be added.
리턴 void

ForName() 공개 정적인 메소드

Returns a reference to the named RuleSet instance if it exists.
public static ForName ( string name ) : RuleSet
name string The name of the required RuleSet.
리턴 RuleSet

Remove() 공개 메소드

Attempts to remove a given Rule from the collection held by the RuleSet.
public Remove ( Rule rule ) : Rule
rule Rule The to be removed.
리턴 Rule

Remove() 공개 메소드

Attempts to remove a Rule with the given name from the collection held by the RuleSet.
public Remove ( string name ) : Rule
name string The name of the to be removed.
리턴 Rule

RuleSet() 공개 메소드

Constructs a named empty RuleSet.
public RuleSet ( string name ) : System
name string
리턴 System

Validate() 보호된 메소드

Determines if the XmlDocument instance indexed by the provided NodeIndex has business data content that passes a validation test. If errors are detected they will be reported through the ValidationErrorHandler delegate passed as an argument.
Note that test returns true if it does not fail, including circumstances when the test is inapplicable to the XmlDocument under examination.
protected Validate ( NodeIndex nodeIndex, ValidationErrorHandler errorHandler ) : bool
nodeIndex HandCoded.Xml.NodeIndex The instance to examine.
errorHandler ValidationErrorHandler An delegate used to report /// validation failures.
리턴 bool