Find an item through IBindingList¶
This operation is clsBindableCollectionBase's explicit IBindingList.Find(...) implementation. Rather than searching the collection itself, it forwards every request to the protected IBindingList_Find(...) extension point, so the actual search algorithm is entirely the subclass's responsibility.
| Field | Value |
|---|---|
| Operation ID | OP-BIND-004 |
| Trigger | Caller invokes IBindingList.Find(PropertyDescriptor property, object key). |
| Inputs | PropertyDescriptor property, object key. |
| Outputs | Integer index from IBindingList_Find(...); the unoverridden base hook always returns -1. |
| Primary components | clsBindableCollectionBase.IBindingList.Find, clsBindableCollectionBase.IBindingList_Find |
| Entry point | SAIF.Framework.Bindable\clsBindableCollectionBase.cs |
Steps¶
- A caller invokes the explicit
IBindingList.Find(...)implementation, supplying the property to search on and the key value to match. - The method forwards both arguments unchanged to the protected virtual
IBindingList_Find(property, key)hook. - The hook returns an integer index — its meaning depends entirely on whether a subclass has overridden it.
- The method returns that integer result to the caller without further interpretation.
- In the base class, the default
IBindingList_Find(...)implementation simply returns-1, so an unoverridden collection reports every search as a non-match.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([Caller invokes IBindingList.Find]) --> Delegate[Call IBindingList_Find(property, key)]
Delegate --> Result{Returned index}
Result -->|>= 0| Found([Return matching index])
Result -->|-1| NotFound([Return not found indicator])
Failure and edge-case behavior¶
- Base implementation only: the operation returns
-1for every call, so no match is ever reported unless a subclass overridesIBindingList_Find(...)with real lookup logic. - The method does not check
AllowFindbefore forwarding: a direct caller can still invokeFind(...)even whenSupportsSearchingreportsfalse, and will simply receive whatever the hook returns.
Related documentation¶
Sources¶
SAIF.Framework.Bindable\clsBindableCollectionBase.cs