wx.ComponentModel.IDataModel Interface Reference

Inheritance diagram for wx.ComponentModel.IDataModel:

wx.ComponentModel.DataModelBase wx.ComponentModel.PropertyModel wx.ComponentModel.ValueModel

List of all members.

Public Member Functions

void BeginInit ()
void BeginSetValue (object newValue)
void EndInit ()
void EndSetValue (bool commitOrRollback)
void PropagateValue ()

Public Attributes

event ValueChangedHandler OnValueChange

Properties

IErrorHandler ErrorHandler [get, set]
bool PropagatesChanges [get]
Type ReferenceType [get]
object Value [get, set]


Detailed Description

Interface of nodes in the dependency network.

Member Function Documentation

void wx.ComponentModel.IDataModel.BeginInit (  ) 

All events will be deferred until EndInit() is called.

Implemented in wx.ComponentModel.DataModelBase.

void wx.ComponentModel.IDataModel.BeginSetValue ( object  newValue  ) 

This will assign newValue and assign value propagation. Call EndSetValue() to end this transaction.

Please note, that this will raise a System.ApplicationException if BeginSetValue() has been run without a following EndSetValue() and both values differ. This is to avoid non-terminating recursions. Please note, that dependency networks shall have the form of acyclic graphs. In acyclic graphs, propagation of dependencies is known to terminate.

Implemented in wx.ComponentModel.DataModelBase.

void wx.ComponentModel.IDataModel.EndInit (  ) 

Fires events that have been deferred by BeginnInit(). However, redundant events will not fire. Example: If this changes its value twice after BeginInit(), only the final assignment will be communicated by events.

This is usually the same as PropagateValue() but additionally ends BeginnInit().

Implemented in wx.ComponentModel.DataModelBase.

void wx.ComponentModel.IDataModel.EndSetValue ( bool  commitOrRollback  ) 

Ends transaction safe setting of a value that has been initialized by BeginSetValue().

Parameters:
commitOrRollback is true if the changes shall be committed and false if this shall rollback all changes since the last BeginSetValue().

Implemented in wx.ComponentModel.DataModelBase.

void wx.ComponentModel.IDataModel.PropagateValue (  ) 

Create events as if the current value has been set. The corresponding change event will have the current value as old value as well as new value.

Implemented in wx.ComponentModel.DataModelBase.


Member Data Documentation

event ValueChangedHandler wx.ComponentModel.IDataModel.OnValueChange

This will be called on any change to Value.

Implemented in wx.ComponentModel.DataModelBase.


Property Documentation

IErrorHandler wx.ComponentModel.IDataModel.ErrorHandler [get, set]

This is the used error handler. This may be null.

Implemented in wx.ComponentModel.DataModelBase.

bool wx.ComponentModel.IDataModel.PropagatesChanges [get]

True iff all models, that this depends on, fire an event for changing a value.

Implemented in wx.ComponentModel.DataModelBase, wx.ComponentModel.ValueModel, and wx.ComponentModel.PropertyModel.

Type wx.ComponentModel.IDataModel.ReferenceType [get]

This is the reference type. This contraints assignments to Value. If reflection is used to define labale texts or visible parts of the model, then this type will be used.

Implemented in wx.ComponentModel.DataModelBase.

object wx.ComponentModel.IDataModel.Value [get, set]

Read or change the encapsulated model. Writing this value is always equivalent to

         IDataModel m=...;
         m.Value=value; // this is equivalent to the following
         
         if (this._referenceType.IsInstanceOfType(value))
         {
             try
             {
                m.BeginSetValue(value);
                m.EndSetValue(true);
             }
             catch (ErrorMessageException exc)
             {
                exc.Show(m.ErrorHandler);
                m.EndSetValue(false);
             }
             catch (Exception exc)
             {
                m.EndSetValue(false);
                throw exc;
             }
         }
         else
           throw new ArgumentException();

The compatibility with the reference type is often tested in BeginSetValue() instead.

Please note, that this property is required to return the new value while propagating a change.

Implemented in wx.ComponentModel.DataModelBase, and wx.ComponentModel.ValueModel.


Manual of the wx.NET   (c) 2003-2011 the wx.NET project at   Get wx.NET at SourceForge.net. Fast, secure and Free Open Source software downloads