clsBindableCollectionBase¶
clsBindableCollectionBase is an abstract base class that implements System.ComponentModel.IBindingList over System.Collections.CollectionBase, so subclass collections can be bound to WinForms/WebForms data-bound controls (grids, list controls) with add/edit/remove/sort/find support hooks.
Purpose¶
- Provide a reusable
IBindingListimplementation overCollectionBaseso subclasses do not need to re-implement the binding-list contract themselves.
Context¶
- Namespace:
SAIF.Framework - Assembly/package:
SAIF.BOF.Framework.Bindable.csproj(packed into theSAIF.BOF.FrameworkNuGet package)* - Base class / interfaces:
System.Collections.CollectionBase,System.ComponentModel.IBindingList
Public members¶
| Member | Signature | Purpose |
|---|---|---|
ListChanged |
event ListChangedEventHandler ListChanged |
Serialization-safe ([NonSerialized]) event raised when the collection's contents change. |
AddNew |
object AddNew() |
Explicit IBindingList implementation; adds a new item to the collection. |
AllowEdit |
bool AllowEdit |
Explicit IBindingList implementation; reports whether items can be edited. |
AllowNew |
bool AllowNew |
Explicit IBindingList implementation; reports whether new items can be added. |
AllowRemove |
bool AllowRemove |
Explicit IBindingList implementation; reports whether items can be removed. |
SupportsSearching |
bool SupportsSearching |
Explicit IBindingList implementation; reports search support. |
SupportsSorting |
bool SupportsSorting |
Explicit IBindingList implementation; reports sort support. |
SupportsChangeNotification |
bool SupportsChangeNotification |
Explicit IBindingList implementation; always returns true. |
Find |
int Find(PropertyDescriptor property, object key) |
Explicit IBindingList implementation; delegates to the protected IBindingList_Find extension point. |
AddIndex |
void AddIndex(PropertyDescriptor property) |
Explicit IBindingList implementation; no-op. |
RemoveIndex |
void RemoveIndex(PropertyDescriptor property) |
Explicit IBindingList implementation; no-op. |
ApplySort |
void ApplySort(PropertyDescriptor property, ListSortDirection direction) |
Explicit IBindingList implementation; delegates to the protected IBindingList_ApplySort extension point. |
RemoveSort |
void RemoveSort() |
Explicit IBindingList implementation; delegates to the protected IBindingList_RemoveSort extension point. |
IsSorted |
bool IsSorted |
Explicit IBindingList implementation; delegates to the protected IBindingList_IsSorted extension point. |
SortDirection |
ListSortDirection SortDirection |
Explicit IBindingList implementation; delegates to the protected IBindingList_SortDirection extension point. |
SortProperty |
PropertyDescriptor SortProperty |
Explicit IBindingList implementation; delegates to the protected IBindingList_SortProperty extension point. |
Behavioral notes¶
- Protected control flags
AllowNew,AllowEdit,AllowRemove,AllowSort,AllowFindall default tofalse, so a subclass must override these to permit the corresponding operation from a data-bound control.* - The
On*Completeoverrides (OnInsertComplete,OnClearComplete,OnRemoveComplete,OnSetComplete) are invoked automatically by the underlyingCollectionBasemachinery in response to collection mutations, and each raisesOnListChangedwith the correspondingListChangedType. - The protected
m_CriteriaObjectfield (Object) mirrors the same field found inclsBindableBase; its intended relationship to the SAIF BOFCriteria/IBusinessCriteriapattern is inferred but not confirmed by any code in this library.* - Protected virtual extension points intended for subclass override include
OnAddNew(),IBindingList_Find(...),IBindingList_IsSorted,IBindingList_SortProperty,IBindingList_SortDirection,IBindingList_ApplySort(...), andIBindingList_RemoveSort(). - No consumers of this class exist within this library's own source; actual subclassing usage is outside this library's scope and unverified.**
Constraints and usage notes¶
- Subclasses that need full data-bound-grid support (adding, editing, removing, sorting, or finding rows) must override the relevant
Allow*flags and protectedIBindingList_*extension points; the base implementation is conservative by default (all flagsfalse, index operations are no-ops). - The
ListChangedevent is marked[NonSerialized], so it is excluded from binary/XML serialization of the subclass instance.
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
SAIF.Framework.Bindable\clsBindableCollectionBase.cs