C# Class HandCoded.Validation.DelegatedRule

The DelegatedRule class provides a implementation of the abstract Rule class that allows the use of delegates.
Inheritance: Rule
Exibir arquivo Open project: formicary/fpml-toolkit-csharp

Public Methods

Method Description
DelegatedRule ( Precondition precondition, string name, RuleDelegate function ) : System

Constructs a DelegatedRule with the given name and that applies in the circumstances defines by its Precondition.

DelegatedRule ( string name, RuleDelegate function ) : System

Constructs a DelegatedRule that applies to any document.

Protected Methods

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

Method Details

DelegatedRule() public method

Constructs a DelegatedRule with the given name and that applies in the circumstances defines by its Precondition.
public DelegatedRule ( Precondition precondition, string name, RuleDelegate function ) : System
precondition Precondition A Precondition instance.
name string The unique name for the rule.
function RuleDelegate The delegate function.
return System

DelegatedRule() public method

Constructs a DelegatedRule that applies to any document.
public DelegatedRule ( string name, RuleDelegate function ) : System
name string The unique name for the rule.
function RuleDelegate The delegate function.
return System

Validate() protected method

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 instance 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 instance used to report /// validation failures.
return bool