Table of Contents

Class CachedSynchronizedList<T>

Namespace
Ecng.Collections
Assembly
Ecng.Collections.dll

Represents a thread-safe list with a cached array of its elements for improved performance.

public class CachedSynchronizedList<T> : SynchronizedList<T>, IList, ICollection, ISynchronizedCollection<T>, ISynchronizedCollection, INotifyListEx<T>, INotifyList<T>, INotifyCollection<T>, IListEx<T>, IList<T>, ICollectionEx<T>, ICollection<T>, IEnumerable<T>, IEnumerable

Type Parameters

T

The type of elements in the list.

Inheritance
CachedSynchronizedList<T>
Implements
Inherited Members
Extension Methods

Constructors

CachedSynchronizedList()

Initializes a new instance of the CachedSynchronizedList<T> class.

public CachedSynchronizedList()

CachedSynchronizedList(int)

Initializes a new instance of the CachedSynchronizedList<T> class with the specified initial capacity.

public CachedSynchronizedList(int capacity)

Parameters

capacity int

The initial number of elements that the list can contain.

Properties

Cache

Gets a cached array of the elements in the list.

public T[] Cache { get; }

Property Value

T[]

Remarks

The array is cached for performance and is reset when the list is modified.

Methods

OnChanged()

Called when the list is modified to reset the cached array.

protected override void OnChanged()