C# Class Tortuga.Anchor.Modeling.Internals.AbstractModelBase

Inheritance: INotifyPropertyChanged, INotifyPropertyChangedWeak, IValidatable
Mostra file Open project: docevaad/Anchor

Private Properties

Property Type Description
Initialize void
InvokePropertyChanged void
OnErrorsChanged void
_ModelBase_OnDeserializing void

Public Methods

Method Description
AddHandler ( IListener eventHandler ) : void

Adds a weak event handler.

ClearErrors ( ) : void

Clears the error collections and the HasErrors property

GetAllErrors ( ) : ReadOnlyCollection

Returns a collection of all errors (object and property level).

Call Validate() to refresh this property.

GetErrors ( ) : ReadOnlyCollection

Returns a collection of object-level errors.

Call Validate() to refresh this property.

GetErrors ( string propertyName ) : ReadOnlyCollection

Returns a collection of property-level errors.

Call Validate() to refresh this property.

RemoveHandler ( IListener eventHandler ) : void

Removes a weak event handler.

Validate ( ) : bool

This forces the object to be completely revalidated.

Protected Methods

Method Description
AbstractModelBase ( ) : System

Initializes a new instance of the AbstractModelBase class.

OnErrorsChanged ( string propertyName ) : void

Used to manually invoke the ErrorsChanged event.

OnValidateObject ( ValidationResultCollection results ) : void

Override this method to add imperative validation at the object level.

OnValidateProperty ( string propertyName, ValidationResultCollection results ) : void

Override this method to add imperative validation at the property level.

Private Methods

Method Description
Initialize ( ) : void
InvokePropertyChanged ( PropertyChangedEventArgs e ) : void

Triggers the PropertyChanged event.

OnErrorsChanged ( string propertyName, ErrorsDictionaryUpdateType updateType ) : void

Invoke this method to signal the events associated with changing the errors dictionary. The parameter updateType is returned by the methods on ErrorsDictionary.

_ModelBase_OnDeserializing ( StreamingContext context ) : void

Method Details

AbstractModelBase() protected method

Initializes a new instance of the AbstractModelBase class.
protected AbstractModelBase ( ) : System
return System

AddHandler() public method

Adds a weak event handler.
eventHandler;eventHandler is null.
public AddHandler ( IListener eventHandler ) : void
eventHandler IListener
return void

ClearErrors() public method

Clears the error collections and the HasErrors property
public ClearErrors ( ) : void
return void

GetAllErrors() public method

Returns a collection of all errors (object and property level).
Call Validate() to refresh this property.
public GetAllErrors ( ) : ReadOnlyCollection
return ReadOnlyCollection

GetErrors() public method

Returns a collection of object-level errors.
Call Validate() to refresh this property.
public GetErrors ( ) : ReadOnlyCollection
return ReadOnlyCollection

GetErrors() public method

Returns a collection of property-level errors.
Call Validate() to refresh this property.
public GetErrors ( string propertyName ) : ReadOnlyCollection
propertyName string Null or String.Empty will return the object-level errors
return ReadOnlyCollection

OnErrorsChanged() protected method

Used to manually invoke the ErrorsChanged event.
protected OnErrorsChanged ( string propertyName ) : void
propertyName string Name of the property.
return void

OnValidateObject() protected method

Override this method to add imperative validation at the object level.
protected OnValidateObject ( ValidationResultCollection results ) : void
results ValidationResultCollection A collection of the declarative validation errors. You may add and remove errors from this collection.
return void

OnValidateProperty() protected method

Override this method to add imperative validation at the property level.
protected OnValidateProperty ( string propertyName, ValidationResultCollection results ) : void
propertyName string The name of the property being validated.
results ValidationResultCollection A collection of the declarative validation errors. You may add and remove errors from this collection.
return void

RemoveHandler() public method

Removes a weak event handler.
eventHandler;eventHandler is null.
public RemoveHandler ( IListener eventHandler ) : void
eventHandler IListener
return void

Validate() public abstract method

This forces the object to be completely revalidated.
public abstract Validate ( ) : bool
return bool