New to Telerik UI for WinForms? Start a free 30-day trial

Indexes a collection view using list-based processing for smaller list sources and an alternate path for larger sources.

Definition

Namespace:Telerik.Collections.Generic

Assembly:Telerik.WinControls.dll

Type Parameters:

T

The data-item type stored by the index.

Syntax:

C#
public class HybridIndex<T> : Index<T>, IReadOnlyCollection<T>, IEnumerable where T : IDataItem

Inheritance: objectIndex<T>HybridIndex<T>

Implements: IEnumerableIReadOnlyCollection<T>

Inherited Members Index<T>.GetItemsOnPage(int)Index<T>.GetItemPageIndex(T)Index<T>.Contains(T)Index<T>.CopyTo(T[], int)Index<T>.IndexOf(T)Index<T>.GetEnumerator()Index<T>.CollectionViewIndex<T>.CountIndex<T>.this[int]...

Constructors

Initializes an index using an explicit source sequence and the specified view's operations.

C#
public HybridIndex(RadCollectionView<T> collectionView, IEnumerable<T> source)
Parameters:collectionViewRadCollectionView<T>

The view whose filtering and sorting settings determine the indexed items.

sourceIEnumerable<T>

The sequence to index.

Initializes an index using the source sequence of the specified view.

C#
public HybridIndex(RadCollectionView<T> collectionView)
Parameters:collectionViewRadCollectionView<T>

The view whose source and operations determine the indexed items.

Properties

Items

IList<T>

Gets the current indexed items, rebuilding them when the view version changes.

C#
public override IList<T> Items { get; }

Overrides: Index<T>.Items

Gets or sets whether filtering is distributed across worker threads when the index is rebuilt.

C#
public bool MultithreadedFiltering { get; set; }

Gets or sets the item-count limit for list-based processing of list sources; the default is 10,000.

C#
public int Threshold { get; set; }

Methods

Collects items that pass the collection view's filter.

C#
protected virtual List<T> GetFilteredItems(IEnumerable<T> e)
Parameters:eIEnumerable<T>

The sequence to evaluate.

Returns:

List<T>

The matching items in enumeration order.

When MultithreadedFiltering is enabled, filter checks are divided among worker threads.

Replaces the source sequence and initializes the index from it.

C#
public override void Load(IEnumerable<T> source)
Parameters:sourceIEnumerable<T>

The sequence to index.

Overrides: Index<T>.Load(IEnumerable<T>)

Rebuilds the index when its cached version differs from the collection view.

C#
protected override void Perform()

Overrides: Index<T>.Perform()

A source implementing IList uses list processing when its count does not exceed Threshold; other sources use the alternate path.

Processes the source using the alternate indexing path, using a red-black tree when sorting is active.

C#
protected virtual void PerformWithBinaryTree()

Filters and sorts items using a list, preserving source order for items that compare equally.

C#
protected virtual void PerformWithList()

Compatibility hook that delegates to PerformWithList().

C#
[Obsolete("Override the PerformWithList method instead")]
protected virtual void PerformWithQuickSort()

Increments the cached version marker used by Perform().

C#
protected override void SetDirty()

Overrides: Index<T>.SetDirty()