[]
        
(Showing Draft Content)

C1.LiveLinq.IndexedQueryExtensions.ToIndexed

ToIndexed Method

ToIndexed<T>(IObservableSource<T>)

Creates an IIndexedSource<T> based on the specified IObservableSource<T> collection.

Declaration
public static IIndexedSource<T> ToIndexed<T>(this IObservableSource<T> source)
Parameters
Type Name Description
IObservableSource<T> source

An IObservableSource<T> collection to base an IIndexedSource<T> on.

Returns
Type Description
IIndexedSource<T>

An IIndexedSource<T> that contains the same elements as the IObservableSource<T> collection and enables indexing of that collection.

Type Parameters
Name Description
T

The type of the elements in the collection.

Remarks

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.

ToIndexed<T>(IBindingList)

Creates an IndexedCollection<T> based on the specified IBindingList data source.

Declaration
public static IndexedCollection<T> ToIndexed<T>(this IBindingList source)
Parameters
Type Name Description
IBindingList source

An IBindingList data source to represent as an IndexedCollection<T>.

Returns
Type Description
IndexedCollection<T>

An IndexedCollection<T> that contains the same elements as the IBindingList and enables indexing of that data source.

Type Parameters
Name Description
T

The type of the elements in the collection.

Remarks

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.

ToIndexed<T>(BindingList<T>)

A typed specialization of the ToIndexed<T>(IBindingList) method.

Declaration
public static IndexedCollection<T> ToIndexed<T>(this BindingList<T> source)
Parameters
Type Name Description
BindingList<T> source

A BindingList<T> data source to represent as an IndexedCollection<T>.

Returns
Type Description
IndexedCollection<T>

An IIndexedSource<T> that contains the same elements as the BindingList<T> and enables indexing of that data source.

Type Parameters
Name Description
T

The type of the elements in the collection.