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
-
BaseCollection<T, List<T>>SynchronizedCollection<T, List<T>>CachedSynchronizedList<T>
- Implements
-
INotifyList<T>IListEx<T>IList<T>ICollection<T>IEnumerable<T>
- 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
intThe 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()