C# Class Habanero.BO.DataSetProvider

Provides a super-class for data-set providers for business objects
Inheritance: IDataSetProvider
Datei anzeigen Open project: Chillisoft/habanero

Protected Properties

Property Type Description
_boAddedHandler EventHandler
_collection IBusinessObjectCollection
_propUpdatedEventHandler EventHandler
_removedHandler EventHandler
_table System.Data.DataTable
_uiGridProperties ICollection
_updatedHandler EventHandler

Public Methods

Method Description
Find ( System.Guid objectID ) : IBusinessObject

Returns a business object that matches the ID provided

FindRow ( IBusinessObject bo ) : int

Finds the row number in which a specified business object resides

GetDataView ( IUIGrid uiGrid ) : IBindingListView

Returns a data view for the UIGridDef provided

InitialiseLocalData ( ) : void

Initialises the local data

RegisterForEvents ( ) : void

Adds handlers to be called when updates occur

UpdateBusinessObjectRowValues ( IBusinessObject businessObject ) : void

Updates the row values for the specified IBusinessObject.

Protected Methods

Method Description
BOAddedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void

Handles the event of a business object being added. Adds a new data row containing the object.

DataSetProvider ( IBusinessObjectCollection collection ) : System

Constructor to initialise a provider with a specified business object collection

DeregisterForBOEvents ( ) : void

Derigisters the Data Set Provider from all events raised by the BO collection.

DeregisterForTableEvents ( ) : void

Deregisters for all events to the _table

GetValues ( IBusinessObject businessObject ) : object[]

Gets a list of the property values to display to the user

RegisterForBOEvents ( ) : void

Registers for all events from the _collection

RegisterForTableEvents ( ) : void

Registers for all events to the _table

RemovedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void

Handles the event of a business object being removed. Removes the data row that contains the object.

Private Methods

Method Description
AddColumn ( IUIGridColumn uiProperty, IClassDef classDef ) : void
Find ( DataRow row ) : IBusinessObject
Find ( int rowNum ) : IBusinessObject
GetDataTable ( IUIGrid uiGrid ) : DataTable
GetPropertyType ( IClassDef classDef, string propertyName ) : Type
IDUpdatedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void

Updates the grid ID column when the Business's ID is changed.

LoadBusinessObject ( IBusinessObject businessObject ) : void

Adds the Business Object to the DataTable

PropertyUpdatedHandler ( object sender, Habanero.Base.BOPropUpdatedEventArgs propEventArgs ) : void
UpdatedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void

Handles the event of a IBusinessObject being updated

Method Details

BOAddedHandler() protected method

Handles the event of a business object being added. Adds a new data row containing the object.
protected BOAddedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void
sender object The object that notified of the event
e Habanero.Base.BOEventArgs Attached arguments regarding the event
return void

DataSetProvider() protected method

Constructor to initialise a provider with a specified business object collection
protected DataSetProvider ( IBusinessObjectCollection collection ) : System
collection IBusinessObjectCollection The business object collection
return System

DeregisterForBOEvents() protected method

Derigisters the Data Set Provider from all events raised by the BO collection.
protected DeregisterForBOEvents ( ) : void
return void

DeregisterForTableEvents() protected method

Deregisters for all events to the _table
protected DeregisterForTableEvents ( ) : void
return void

Find() public method

Returns a business object that matches the ID provided
public Find ( System.Guid objectID ) : IBusinessObject
objectID System.Guid The ID
return IBusinessObject

FindRow() public method

Finds the row number in which a specified business object resides
public FindRow ( IBusinessObject bo ) : int
bo IBusinessObject The business object to search for
return int

GetDataView() public method

Returns a data view for the UIGridDef provided
public GetDataView ( IUIGrid uiGrid ) : IBindingListView
uiGrid IUIGrid The UIGridDef
return IBindingListView

GetValues() protected method

Gets a list of the property values to display to the user
protected GetValues ( IBusinessObject businessObject ) : object[]
businessObject IBusinessObject The business object whose /// properties are to be displayed
return object[]

InitialiseLocalData() public abstract method

Initialises the local data
public abstract InitialiseLocalData ( ) : void
return void

RegisterForBOEvents() protected method

Registers for all events from the _collection
protected RegisterForBOEvents ( ) : void
return void

RegisterForEvents() public method

Adds handlers to be called when updates occur
public RegisterForEvents ( ) : void
return void

RegisterForTableEvents() protected method

Registers for all events to the _table
protected RegisterForTableEvents ( ) : void
return void

RemovedHandler() protected method

Handles the event of a business object being removed. Removes the data row that contains the object.
protected RemovedHandler ( object sender, Habanero.Base.BOEventArgs e ) : void
sender object The object that notified of the event
e Habanero.Base.BOEventArgs Attached arguments regarding the event
return void

UpdateBusinessObjectRowValues() public method

Updates the row values for the specified IBusinessObject.
public UpdateBusinessObjectRowValues ( IBusinessObject businessObject ) : void
businessObject IBusinessObject The for which the row values need to updated.
return void

Property Details

_boAddedHandler protected_oe property

A handler for the IBusinessObject has been added to the _collection.
protected EventHandler _boAddedHandler
return EventHandler

_collection protected_oe property

The IBusinessObjectCollection of IBusinessObjects that are being mapped in this DataSetProvider (i.e. are being copied to the DataTable.
protected IBusinessObjectCollection _collection
return IBusinessObjectCollection

_propUpdatedEventHandler protected_oe property

A handler for the IBusinessObject has had one of its properties updated
protected EventHandler _propUpdatedEventHandler
return EventHandler

_removedHandler protected_oe property

A handler for the IBusinessObject has been removed from the _collection.
protected EventHandler _removedHandler
return EventHandler

_table protected_oe property

The DataTable that is set up to represent the items in this collection.
protected DataTable,System.Data _table
return System.Data.DataTable

_uiGridProperties protected_oe property

The collection of UIGridColumns that are being shown in this DataTable.
protected ICollection _uiGridProperties
return ICollection

_updatedHandler protected_oe property

A handler for the IBusinessObject has been persisted.
protected EventHandler _updatedHandler
return EventHandler