C# Class Watchdog.Validation.Core.ClientUtil.ValidationCollectionExtensions

Extension method for an ICollection{T}. These can be used by users of Watchdog to assist with managing their collections of Errors on their viewmodel.
Mostra file Open project: JDolinger/Watchdog

Public Methods

Method Description
Add ( this collection, string errorKey, string message ) : void

Creates a ValidationError and adds it to the collection.

ClearValidationError ( this collection, string targetFieldKey ) : void

Clears all ValidationError for the named target field. This will not clear any ConversionError present. These should only be removed by WPF when it detects that a binding with a failed conversion has now been correct.

GetValidationErrors ( this collection ) : IEnumerable

Gets the ValidationError in the given ICollection{IError}

MatchingErrorKey ( this collection, string errorKey ) : IEnumerable
MatchingField ( this collection, string targetFieldKey ) : IEnumerable

Retrieves the IError matching the given field key.

Method Details

Add() public static method

Creates a ValidationError and adds it to the collection.
public static Add ( this collection, string errorKey, string message ) : void
collection this The target collection to add to.
errorKey string
message string The associated message.
return void

ClearValidationError() public static method

Clears all ValidationError for the named target field. This will not clear any ConversionError present. These should only be removed by WPF when it detects that a binding with a failed conversion has now been correct.
public static ClearValidationError ( this collection, string targetFieldKey ) : void
collection this The source collection.
targetFieldKey string The field for which errors are being cleared.
return void

GetValidationErrors() public static method

Gets the ValidationError in the given ICollection{IError}
public static GetValidationErrors ( this collection ) : IEnumerable
collection this The source collection.
return IEnumerable

MatchingErrorKey() public static method

public static MatchingErrorKey ( this collection, string errorKey ) : IEnumerable
collection this
errorKey string
return IEnumerable

MatchingField() public static method

Retrieves the IError matching the given field key.
public static MatchingField ( this collection, string targetFieldKey ) : IEnumerable
collection this The source collection.
targetFieldKey string The field for which errors are being search for.
return IEnumerable