C# Class MvvmValidation.ValidationHelper

Mostra file Open project: pglazkov/MvvmValidation Class Usage Examples

Private Properties

Property Type Description
AddAsyncRule IAsyncValidationRule
AddAsyncRule IAsyncValidationRule
AddAsyncRule IAsyncValidationRule
AddAsyncRule IAsyncValidationRule
AddAsyncRule IAsyncValidationRule
AddAsyncRule IAsyncValidationRule
AddErrorsFromRuleResult void
AddRule IValidationRule
AddRule IValidationRule
AddRule IValidationRule
AddRule IValidationRule
AddRule IValidationRule
AddRuleCore IAsyncValidationRule
CreatePropertyValidationTarget IValidationTarget
CreateRuleFilterFor bool>.Func
ExecuteRuleAsync Task
ExecuteValidationRulesAsync Task
GetCurrentValidationResultForRule RuleResult
GetResult ValidationResult
GetResult ValidationResult
GetResult ValidationResult
GetResultInternal ValidationResult
GetResultInternal ValidationResult
GetRuleMapForTarget RuleResult>.IDictionary
GetRulesForTarget ReadOnlyCollection
NotifyResultChanged void
RegisterValidationRule void
SaveRuleValidationResultAndNotifyIfNeeded void
ShouldExecuteOnAlreadyInvalidTarget bool
SuppressValidation IDisposable
UnregisterAllValidationRules void
UnregisterValidationRule void
Validate ValidationResult
Validate ValidationResult
ValidateAll ValidationResult
ValidateAllAsync Task
ValidateAsync Task
ValidateAsync Task
ValidateCaller ValidationResult
ValidateCallerAsync Task
ValidateInternal ValidationResult
ValidateInternalAsync Task

Public Methods

Method Description
AddRule ( [ propertyExpression, [ validateDelegate ) : IValidationRule

OBSOLTE: If you are using C# 6 compiler consider using another overload of this method that takes a string argument (AddRule(string,System.Func{MvvmValidation.RuleResult})) and invoke it with nameof(MyProperty) instead.

RemoveAllRules ( ) : void

Removes all validation rules.

RemoveRule ( [ rule ) : void

Removes the specified rule.

Reset ( ) : void

Resets the validation state. If there were any broken rules then the targets for those rules will become valid again and the ResultChanged event will be rised.

ValidationHelper ( ) : System

Initializes a new instance of the ValidationHelper class.

ValidationHelper ( ValidationSettings settings ) : System

Initializes a new instance of the ValidationHelper class.

Private Methods

Method Description
AddAsyncRule ( [ property1Name, [ property2Name, [ validateAction ) : IAsyncValidationRule
AddAsyncRule ( [ target, [ validateAction ) : IAsyncValidationRule
AddAsyncRule ( [ validateAction ) : IAsyncValidationRule
AddAsyncRule ( [ propertyExpression, [ validateAction ) : IAsyncValidationRule
AddAsyncRule ( [ property1Expression, [ property2Expression, [ validateAction ) : IAsyncValidationRule
AddAsyncRule ( [ properties, [ validateAction ) : IAsyncValidationRule
AddErrorsFromRuleResult ( ValidationResult resultToAddTo, ValidationRule validationRule, RuleResult ruleResult ) : void
AddRule ( [ property1Name, [ property2Name, [ validateDelegate ) : IValidationRule
AddRule ( [ target, [ validateDelegate ) : IValidationRule
AddRule ( [ validateDelegate ) : IValidationRule
AddRule ( [ property1Expression, [ property2Expression, [ validateDelegate ) : IValidationRule
AddRule ( [ properties, [ validateDelegate ) : IValidationRule
AddRuleCore ( IValidationTarget target, Func validateDelegate, Func asyncValidateAction ) : IAsyncValidationRule
CreatePropertyValidationTarget ( IEnumerable properties ) : IValidationTarget
CreateRuleFilterFor ( object target ) : bool>.Func
ExecuteRuleAsync ( ValidationRule rule, ISet failedTargets, ValidationResult validationResultAccumulator, SynchronizationContext syncContext ) : Task
ExecuteValidationRulesAsync ( IEnumerable rulesToExecute, SynchronizationContext syncContext = null ) : Task
GetCurrentValidationResultForRule ( RuleResult>.IDictionary ruleMap, ValidationRule rule ) : RuleResult
GetResult ( ) : ValidationResult
GetResult ( [ target ) : ValidationResult
GetResult ( [ propertyExpression ) : ValidationResult
GetResultInternal ( ) : ValidationResult
GetResultInternal ( object target ) : ValidationResult
GetRuleMapForTarget ( object target ) : RuleResult>.IDictionary
GetRulesForTarget ( object target ) : ReadOnlyCollection
NotifyResultChanged ( object target, ValidationResult newResult, SynchronizationContext syncContext, bool useSyncContext = true ) : void
RegisterValidationRule ( ValidationRule rule ) : void
SaveRuleValidationResultAndNotifyIfNeeded ( ValidationRule rule, RuleResult ruleResult, SynchronizationContext syncContext ) : void
ShouldExecuteOnAlreadyInvalidTarget ( ValidationRule rule ) : bool
SuppressValidation ( ) : IDisposable
UnregisterAllValidationRules ( ) : void
UnregisterValidationRule ( ValidationRule rule ) : void
Validate ( [ targetName ) : ValidationResult
Validate ( [ propertyPathExpression ) : ValidationResult
ValidateAll ( ) : ValidationResult
ValidateAllAsync ( ) : Task
ValidateAsync ( [ targetName ) : Task
ValidateAsync ( [ propertyPathExpression ) : Task
ValidateCaller ( [ callerName = null ) : ValidationResult
ValidateCallerAsync ( [ callerName = null ) : Task
ValidateInternal ( object target ) : ValidationResult
ValidateInternalAsync ( object target ) : Task

Method Details

AddRule() public method

OBSOLTE: If you are using C# 6 compiler consider using another overload of this method that takes a string argument (AddRule(string,System.Func{MvvmValidation.RuleResult})) and invoke it with nameof(MyProperty) instead.
public AddRule ( [ propertyExpression, [ validateDelegate ) : IValidationRule
propertyExpression [
validateDelegate [
return IValidationRule

RemoveAllRules() public method

Removes all validation rules.
public RemoveAllRules ( ) : void
return void

RemoveRule() public method

Removes the specified rule.
public RemoveRule ( [ rule ) : void
rule [ Validation rule instance.
return void

Reset() public method

Resets the validation state. If there were any broken rules then the targets for those rules will become valid again and the ResultChanged event will be rised.
public Reset ( ) : void
return void

ValidationHelper() public method

Initializes a new instance of the ValidationHelper class.
public ValidationHelper ( ) : System
return System

ValidationHelper() public method

Initializes a new instance of the ValidationHelper class.
public ValidationHelper ( ValidationSettings settings ) : System
settings ValidationSettings An instance of that control the behavior of this instance of .
return System