The requested page is not available for the requested platform. You are viewing the content for Default platform.

RuleSet.ValidateAllTargets(IObjectSpace, IEnumerable, ContextIdentifiers) Method

Silently (without raising the RuleSet.ValidationCompleted event and throwing the ValidationException) validates multiple targets and returns the result.

Namespace: DevExpress.Persistent.Validation

Assembly: DevExpress.Persistent.Base.v19.1.dll

Declaration

public RuleSetValidationResult ValidateAllTargets(
    IObjectSpace targetObjectSpace,
    IEnumerable targets,
    ContextIdentifiers contextIDs
)
Public Function ValidateAllTargets(
    targetObjectSpace As IObjectSpace,
    targets As IEnumerable,
    contextIDs As ContextIdentifiers
) As RuleSetValidationResult

Parameters

Name Type Description
targetObjectSpace IObjectSpace

An IObjectSpace used by a validation target.

targets IEnumerable

The list of objects to check.

contextIDs ContextIdentifiers

The ContextIdentifiers object which is a set of validation contexts, rules for which will be collected. Default contexts are stored in the DefaultContexts enumeration.

Returns

Type Description
DevExpress.Persistent.Validation.RuleSetValidationResult

The result of the RuleSet validation.

Remarks

Below is the example of using the ValidateAllTargets method and handling its result.

RuleSetValidationResult validationResult = Validator.RuleSet.ValidateAllTargets(
    ObjectSpace, ObjectSpace.GetObjectsToSave(false), ContextIdentifier.Save);
ValidationResults obj = new ValidationResults(validationResult, base.Application.Model);
bool flag = validationResult.State != ValidationState.Invalid;

This method raises the RuleSet.RuleValidated event for each target.

See Also