[]
Creates an IIndexedSource<T> based on the specified IObservableSource<T> collection.
public static IIndexedSource<T> ToIndexed<T>(this IObservableSource<T> source)
Type | Name | Description |
---|---|---|
IObservableSource<T> | source | An IObservableSource<T> collection to base an IIndexedSource<T> on. |
Type | Description |
---|---|
IIndexedSource<T> | An IIndexedSource<T> that contains the same elements as the IObservableSource<T> collection and enables indexing of that collection. |
Name | Description |
---|---|
T | The type of the elements in the collection. |
Use this method to index and query your collection if that collection is your own custom implementation of the IObservableSource<T> interface.
Elements of the source collection aren't duplicated or copied to a new collection. This method just wraps the original collection in an IIndexedSource<T>, enabling its indexing by using the change notification mechanism of IObservableSource<T>.
Note: Indexes created on the resulting IIndexedSource<T> are owned by it and not by the original collection. Every ToIndexed() call creates a separate object that has its own separate indexes. Avoid calling ToIndexed() repeatedly for the same collection because it can increase the cost of maintaining indexes.
Creates an IndexedCollection<T> based on the specified IBindingList data source.
public static IndexedCollection<T> ToIndexed<T>(this IBindingList source)
Type | Name | Description |
---|---|---|
IBindingList | source | An IBindingList data source to represent as an IndexedCollection<T>. |
Type | Description |
---|---|
IndexedCollection<T> | An IndexedCollection<T> that contains the same elements as the IBindingList and enables indexing of that data source. |
Name | Description |
---|---|
T | The type of the elements in the collection. |
Use this method to index and query your existing data sources. The only requirements for the data source is that it implements the standard data binding interface IBindingList.
Note: Indexes created on the resulting IndexedCollection<T> are owned by it and not by the original data source. Every ToIndexed() call creates a separate object that has its own separate indexes. Avoid calling ToIndexed() repeatedly for the same collection because it can increase the cost of maintaining indexes.
A typed specialization of the ToIndexed<T>(IBindingList) method.
public static IndexedCollection<T> ToIndexed<T>(this BindingList<T> source)
Type | Name | Description |
---|---|---|
BindingList<T> | source | A BindingList<T> data source to represent as an IndexedCollection<T>. |
Type | Description |
---|---|
IndexedCollection<T> | An IIndexedSource<T> that contains the same elements as the BindingList<T> and enables indexing of that data source. |
Name | Description |
---|---|
T | The type of the elements in the collection. |