CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
Csla.DynamicBindingListBase< T > Class Template Reference

This is the base class from which collections of editable root business objects should be derived. More...

Inheritance diagram for Csla.DynamicBindingListBase< T >:
Csla.Core.ExtendedBindingList< T > Csla.Core.IParent Csla.Core.IBusinessObject Csla.Core.MobileBindingList< T > Csla.Core.IExtendedBindingList Csla.Serialization.Mobile.IMobileList Csla.Core.INotifyBusy Csla.Core.INotifyChildChanged Csla.Serialization.Mobile.ISerializationNotification Csla.Serialization.Mobile.IMobileList Csla.Serialization.Mobile.IMobileObject Csla.Core.INotifyUnhandledAsyncException Csla.Serialization.Mobile.IMobileObject

Public Member Functions

 DynamicBindingListBase ()
 Creates an instance of the object. More...
 
SaveItem (T item)
 Saves the specified item in the list. More...
 
virtual T SaveItem (int index)
 Saves the specified item in the list. More...
 
T[] ToArray ()
 Get an array containing all items in the list. More...
 
- Public Member Functions inherited from Csla.Core.ExtendedBindingList< T >
void AddRange (System.Collections.Generic.IEnumerable< T > range)
 Add a range of items to the list. More...
 

Protected Member Functions

virtual void Initialize ()
 Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code. More...
 
virtual void OnSaved (T newObject, Exception e)
 Raises the Saved event. More...
 
override object AddNewCore ()
 Adds a new item to the list. More...
 
override void InsertItem (int index, T item)
 Gives the new object a parent reference to this list. More...
 
override void RemoveItem (int index)
 Removes an item from the list. More...
 
override void SetItem (int index, T item)
 Replaces item in the list. More...
 
override void Child_PropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
 Handles any PropertyChanged event from a child object and echoes it up as a ChildChanged event. More...
 
virtual void OnChildPropertyChanged (object sender, System.ComponentModel.PropertyChangedEventArgs e)
 Override this method to be notified when a child object has been changed. More...
 
override void OnDeserialized ()
 This method is called on a newly deserialized object after deserialization is complete. More...
 
virtual void DataPortal_OnDataPortalInvoke (DataPortalEventArgs e)
 Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalInvokeComplete (DataPortalEventArgs e)
 Called by the server-side DataPortal after calling the requested DataPortal_xyz method. More...
 
virtual void DataPortal_OnDataPortalException (DataPortalEventArgs e, Exception ex)
 Called by the server-side DataPortal if an exception occurs during data access. More...
 
override void OnGetState (SerializationInfo info)
 Override this method to insert your field values into the MobileFormatter serialzation stream. More...
 
override void OnSetState (SerializationInfo info)
 Override this method to retrieve your field values from the MobileFormatter serialzation stream. More...
 
- Protected Member Functions inherited from Csla.Core.ExtendedBindingList< T >
void OnRemovingItem (T removedItem)
 Raise the RemovingItem event. More...
 
override void RemoveItem (int index)
 Remove the item at the specified index. More...
 
virtual void OnBusyChanged (BusyChangedEventArgs args)
 Override this method to be notified when the IsBusy property has changed. More...
 
void OnBusyChanged (string propertyName, bool busy)
 Raises the BusyChanged event for a specific property. More...
 
virtual void OnUnhandledAsyncException (ErrorEventArgs error)
 Method invoked when an unhandled async exception has occurred. More...
 
void OnUnhandledAsyncException (object originalSender, Exception error)
 Raises the UnhandledAsyncException event. More...
 
override void InsertItem (int index, T item)
 Invoked when an item is inserted into the list. More...
 
virtual void OnAddEventHooks (T item)
 Method invoked when events are hooked for a child object. More...
 
virtual void OnRemoveEventHooks (T item)
 Method invoked when events are unhooked for a child object. More...
 
virtual void OnChildChanged (ChildChangedEventArgs e)
 Raises the ChildChanged event, indicating that a child object has been changed. More...
 
virtual void Child_PropertyChanged (object sender, PropertyChangedEventArgs e)
 Handles any PropertyChanged event from a child object and echoes it up as a ChildChanged event. More...
 
- Protected Member Functions inherited from Csla.Core.MobileBindingList< T >
virtual void SetLoadListMode (bool enabled)
 Sets the load list mode for the list More...
 
virtual void OnGetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to get custom child object values from the serialization stream. More...
 
virtual void OnSetChildren (SerializationInfo info, MobileFormatter formatter)
 Override this method to set custom child object values into the serialization stream. More...
 

Properties

EventHandler< Csla.Core.SavedEventArgsSaved
 Event raised when an object has been saved. More...
 
override bool IsBusy [get]
 Gets a value indicating whether this object is currently running an async operation. More...
 
- Properties inherited from Csla.Core.ExtendedBindingList< T >
EventHandler< RemovingItemEventArgsRemovingItem
 Implements a serialization-safe RemovingItem event. More...
 
BusyChangedEventHandler BusyChanged
 Event indicating that the busy status of the object has changed. More...
 
virtual bool IsBusy [get]
 Gets the busy status for this object and its child objects. More...
 
virtual bool IsSelfBusy [get]
 Gets the busy status for this object. More...
 
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during an async operation. More...
 
EventHandler< Csla.Core.ChildChangedEventArgsChildChanged
 Event raised when a child object has been changed. More...
 
IDisposable SuppressListChangedEvents [get]
 Use this object to suppress ListChangedEvents for an entire code block. More...
 
- Properties inherited from Csla.Core.MobileBindingList< T >
LoadListModeObject LoadListMode [get]
 By wrapping this property inside Using block you can set property values on current business object without raising PropertyChanged events and checking user rights. More...
 
- Properties inherited from Csla.Core.INotifyBusy
bool IsBusy [get]
 Gets a value indicating whether the object, or any of the object's child objects, are busy running an asynchronous operation. More...
 
bool IsSelfBusy [get]
 Gets a value indicating whether the object is busy running an asynchronous operation. More...
 
- Properties inherited from Csla.Core.IParent
IParent Parent [get]
 Provide access to the parent reference for use in child object code. More...
 
- Properties inherited from Csla.Core.IBusinessObject
int Identity [get]
 Gets a value representing this object instance's unique identity value within the business object graph. More...
 

Additional Inherited Members

- Events inherited from Csla.Core.IExtendedBindingList
EventHandler< RemovingItemEventArgsRemovingItem
 Event indicating that an item is being removed from the list. More...
 
- Events inherited from Csla.Core.INotifyBusy
BusyChangedEventHandler BusyChanged
 Event raised when the object's busy status changes. More...
 
- Events inherited from Csla.Core.INotifyUnhandledAsyncException
EventHandler< ErrorEventArgsUnhandledAsyncException
 Event indicating that an exception occurred during an asynchronous operation. More...
 
- Events inherited from Csla.Core.INotifyChildChanged
EventHandler< ChildChangedEventArgsChildChanged
 Event indictating that a child object has changed. More...
 

Detailed Description

This is the base class from which collections of editable root business objects should be derived.

Template Parameters
TType of editable root object to contain within the collection.

Your subclass should implement a factory method and should override or overload DataPortal_Fetch() to implement data retrieval.

Saving (inserts or updates) of items in the collection should be handled through the SaveItem() method on the collection.

Removing an item from the collection through Remove() or RemoveAt() causes immediate deletion of the object, by calling the object's Delete() and Save() methods.

Type Constraints
T :Core.IEditableBusinessObject 
T :Core.IUndoableObject 
T :Core.ISavable 
T :IMobileObject 
T :IBusinessObject 

Definition at line 42 of file DynamicBindingListBase.cs.

Constructor & Destructor Documentation

◆ DynamicBindingListBase()

Creates an instance of the object.

Definition at line 52 of file DynamicBindingListBase.cs.

Member Function Documentation

◆ AddNewCore()

override object Csla.DynamicBindingListBase< T >.AddNewCore ( )
protected

Adds a new item to the list.

Returns
The added object

Definition at line 263 of file DynamicBindingListBase.cs.

◆ Child_PropertyChanged()

override void Csla.DynamicBindingListBase< T >.Child_PropertyChanged ( object  sender,
System.ComponentModel.PropertyChangedEventArgs  e 
)
protected

Handles any PropertyChanged event from a child object and echoes it up as a ChildChanged event.

Parameters
senderObject that raised the event.
eProperty changed args.

Definition at line 355 of file DynamicBindingListBase.cs.

◆ DataPortal_OnDataPortalException()

virtual void Csla.DynamicBindingListBase< T >.DataPortal_OnDataPortalException ( DataPortalEventArgs  e,
Exception  ex 
)
protectedvirtual

Called by the server-side DataPortal if an exception occurs during data access.

Parameters
eThe DataPortalContext object passed to the DataPortal.
exThe Exception thrown during data access.

Definition at line 476 of file DynamicBindingListBase.cs.

◆ DataPortal_OnDataPortalInvoke()

virtual void Csla.DynamicBindingListBase< T >.DataPortal_OnDataPortalInvoke ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal prior to calling the requested DataPortal_xyz method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 453 of file DynamicBindingListBase.cs.

◆ DataPortal_OnDataPortalInvokeComplete()

virtual void Csla.DynamicBindingListBase< T >.DataPortal_OnDataPortalInvokeComplete ( DataPortalEventArgs  e)
protectedvirtual

Called by the server-side DataPortal after calling the requested DataPortal_xyz method.

Parameters
eThe DataPortalContext object passed to the DataPortal.

Definition at line 464 of file DynamicBindingListBase.cs.

◆ Initialize()

virtual void Csla.DynamicBindingListBase< T >.Initialize ( )
protectedvirtual

Override this method to set up event handlers so user code in a partial class can respond to events raised by generated code.

Definition at line 66 of file DynamicBindingListBase.cs.

◆ InsertItem()

override void Csla.DynamicBindingListBase< T >.InsertItem ( int  index,
item 
)
protected

Gives the new object a parent reference to this list.

Parameters
indexIndex at which to insert the item.
itemItem to insert.

Definition at line 277 of file DynamicBindingListBase.cs.

◆ OnChildPropertyChanged()

virtual void Csla.DynamicBindingListBase< T >.OnChildPropertyChanged ( object  sender,
System.ComponentModel.PropertyChangedEventArgs  e 
)
protectedvirtual

Override this method to be notified when a child object has been changed.

Parameters
senderChild object where the PropertyChanged event originated.
ePropertyChangedEventArgs from the child object.

Definition at line 391 of file DynamicBindingListBase.cs.

◆ OnDeserialized()

override void Csla.DynamicBindingListBase< T >.OnDeserialized ( )
protectedvirtual

This method is called on a newly deserialized object after deserialization is complete.

Reimplemented from Csla.Core.ExtendedBindingList< T >.

Definition at line 419 of file DynamicBindingListBase.cs.

◆ OnGetState()

override void Csla.DynamicBindingListBase< T >.OnGetState ( SerializationInfo  info)
protectedvirtual

Override this method to insert your field values into the MobileFormatter serialzation stream.

Parameters
infoObject containing the data to serialize.

Reimplemented from Csla.Core.MobileBindingList< T >.

Definition at line 570 of file DynamicBindingListBase.cs.

◆ OnSaved()

virtual void Csla.DynamicBindingListBase< T >.OnSaved ( newObject,
Exception  e 
)
protectedvirtual

Raises the Saved event.

Parameters
newObjectReference to object returned from the save.
eReference to any exception that occurred during the save.

Definition at line 246 of file DynamicBindingListBase.cs.

◆ OnSetState()

override void Csla.DynamicBindingListBase< T >.OnSetState ( SerializationInfo  info)
protectedvirtual

Override this method to retrieve your field values from the MobileFormatter serialzation stream.

Parameters
infoObject containing the data to serialize.

Reimplemented from Csla.Core.MobileBindingList< T >.

Definition at line 583 of file DynamicBindingListBase.cs.

◆ RemoveItem()

override void Csla.DynamicBindingListBase< T >.RemoveItem ( int  index)
protected

Removes an item from the list.

Parameters
indexIndex of the item to be removed.

Definition at line 288 of file DynamicBindingListBase.cs.

◆ SaveItem() [1/2]

virtual T Csla.DynamicBindingListBase< T >.SaveItem ( int  index)
virtual

Saves the specified item in the list.

Parameters
indexIndex of the item to be saved.

This method properly saves the child item, by making sure the item in the collection is properly replaced by the result of the Save() method call.

Definition at line 139 of file DynamicBindingListBase.cs.

◆ SaveItem() [2/2]

T Csla.DynamicBindingListBase< T >.SaveItem ( item)

Saves the specified item in the list.

Parameters
itemReference to the item to be saved.

This method properly saves the child item, by making sure the item in the collection is properly replaced by the result of the Save() method call.

Definition at line 122 of file DynamicBindingListBase.cs.

◆ SetItem()

override void Csla.DynamicBindingListBase< T >.SetItem ( int  index,
item 
)
protected

Replaces item in the list.

Parameters
indexIndex of the item that was replaced.
itemNew item.

Definition at line 316 of file DynamicBindingListBase.cs.

◆ ToArray()

T[] Csla.DynamicBindingListBase< T >.ToArray ( )

Get an array containing all items in the list.

Definition at line 488 of file DynamicBindingListBase.cs.

Property Documentation

◆ IsBusy

override bool Csla.DynamicBindingListBase< T >.IsBusy
get

Gets a value indicating whether this object is currently running an async operation.

Definition at line 544 of file DynamicBindingListBase.cs.

◆ Saved

EventHandler<Csla.Core.SavedEventArgs> Csla.DynamicBindingListBase< T >.Saved
addremove

Event raised when an object has been saved.

Definition at line 209 of file DynamicBindingListBase.cs.