Table of Contents

Class ValidationScope

Namespace
The.Values
Assembly
Instagile.dll

The Scope of a set of Validation Rules determines when those rules will be triggered, and can optionally also apply a Condition (which is an expression evaluated against the Entity being validated)

public abstract class ValidationScope
Inheritance
ValidationScope
Derived
Inherited Members

Properties

CommandKeys

Identifies the commands that will trigger the validation rules when the OnCommand trigger has been specified. The CommandKey will typically be the text on the command button, and only needs to be

public ISet<string> CommandKeys { get; protected init; }

Property Value

ISet<string>

Remarks

Set by calling the OnCommand(commandKeys) method

HasCondition

public virtual bool HasCondition { get; }

Property Value

bool

Severity

public ValidationSeverity Severity { get; protected init; }

Property Value

ValidationSeverity

SummaryMessage

public string? SummaryMessage { get; protected init; }

Property Value

string

Triggers

public ISet<ValidationScope.TriggerEnum> Triggers { get; protected init; }

Property Value

ISet<ValidationScope.TriggerEnum>

Methods

EvaluateCondition(IServices, IEntity?)

public virtual bool EvaluateCondition(IServices services, IEntity? entity)

Parameters

services IServices
entity IEntity

Returns

bool

HasCommandTrigger(string)

public bool HasCommandTrigger(string commandKey)

Parameters

commandKey string

Returns

bool

HasTrigger(TriggerEnum)

public bool HasTrigger(ValidationScope.TriggerEnum trigger)

Parameters

trigger ValidationScope.TriggerEnum

Returns

bool

OnChanged()

public static WrappedValidationScope<IEntity> OnChanged()

Returns

WrappedValidationScope<IEntity>

OnCommand(params string[])

public static WrappedValidationScope<IEntity> OnCommand(params string[] commandKeys)

Parameters

commandKeys string[]

Returns

WrappedValidationScope<IEntity>

OnLostFocus()

public static WrappedValidationScope<IEntity> OnLostFocus()

Returns

WrappedValidationScope<IEntity>

OnRender()

public static WrappedValidationScope<IEntity> OnRender()

Returns

WrappedValidationScope<IEntity>

OnSave()

public static WrappedValidationScope<IEntity> OnSave()

Returns

WrappedValidationScope<IEntity>

WithSummaryMessage(string)

Allows specifying a summary message for the validation rules in the scope

public static WrappedValidationScope<IEntity> WithSummaryMessage(string message)

Parameters

message string

Returns

WrappedValidationScope<IEntity>