[]
        
(Showing Draft Content)

C1.DataCollection.C1CacheDataCollection-1

C1CacheDataCollection<T> Class

Collection that takes another source and cache the items.

Inheritance
C1CacheDataCollection<T>
Namespace: C1.DataCollection
Assembly: C1.DataCollection.dll
Syntax
public class C1CacheDataCollection<T> : C1WrapDataCollection<T>, IDataCollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, INotifyCollectionChanged, ISupportIndexing<T>, INotifyPropertyChanged, IDisposable, ISupportSorting, ISupportFiltering, ISupportGrouping, ISupportVirtualization, ISupportConnection, ISupportAsyncLoading<T>, ISupportIncrementalLoading, ISupportRefreshing, ISupportRangeEditing<T>, ISupportEditing<T>, ISupportCreateNewItem<T>, ISupportPaging, ISupportSource where T : class?
Type Parameters
Name Description
T

The type of the items in the collection.

Remarks

The creation of the items will be delayed until they are accessed. This way the memory and processor usage is optimized.

Constructors

Name Description
C1CacheDataCollection(IEnumerable)

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

Properties

Name Description
NotifySourceResetAsReplace

Gets or sets whether the Reset notifications coming from the source will be notified as a Replace.

Methods

Name Description
CreateInternalList(IReadOnlyList<T>)

Creates the internal list from the source.

Dispose(bool)

Called to dispose resources.

GetCachedItems(int?, int?)

Gets the cached items in the specified range.

GetLoadedItems(int?, int?)

Returns the items that has be loaded so far.

IndexOf(T)

Gets the index of the specified item.

InsertAsync(int, T, CancellationToken)

Inserts the specified item at the specified index in the collection.

InsertRangeAsync(int, IEnumerable<T>, CancellationToken)

Inserts the specified items at the specified startingIndex in the collection.

OnCollectionChanging(NotifyCollectionChangedEventArgs)

Raises the CollectionChanging event.

OnSourceCollectionChanged(object?, NotifyCollectionChangedEventArgs)

Called when the source collection changed.

ReplaceAsync(int, T, CancellationToken)

Replaces the item at the specified index by the specified item.

ReplaceRangeAsync(int, IEnumerable<T>, CancellationToken)

Replaces the items starting at the specified startingIndex by the specified items.

Events

Name Description
CollectionChanging

Occurs before the collection changes.

ItemLoaded

Occurs when an item is added to the cache.

ItemUnloaded

Occurs when an item is removed from the cache.

Extension Methods