[]
        
(Showing Draft Content)

C1.DataCollection.C1VirtualDataCollection-1

C1VirtualDataCollection<T> Class

Base class for data-virtualized collections.

Inheritance
C1VirtualDataCollection<T>
Namespace: C1.DataCollection
Assembly: C1.DataCollection.dll
Syntax
public abstract class C1VirtualDataCollection<T> : C1DataCollectionBase<T?>, IDataCollection<T?>, IReadOnlyList<T?>, IReadOnlyCollection<T?>, IEnumerable<T?>, IEnumerable, INotifyCollectionChanged, ISupportIndexing<T?>, INotifyPropertyChanged, IDisposable, ISupportVirtualization, ISupportRefreshing, ISupportConnection, ISupportAsyncLoading<T>, ISupportSorting, ISupportFiltering, ISupportEditing<T> where T : class?
Type Parameters
Name Description
T
Remarks

Override GetPageAsync to provide the data.

Constructors

Name Description
C1VirtualDataCollection(int, int, TimeSpan?)

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

Properties

Name Description
ConnectionState

Gets the state of the connection to the source.

Count

Gets the number of elements in the collection.

FilterExpression

Gets the filter expression applied to the data.

InternalList

Gets or sets the list that hold the items to be returned in the public api.

IsLoading

Gets whether the collection is getting the data.

IsVirtualizing

Gets whether the collection is virtualizing its data.

this[int]

Gets the element at the specified index in the read-only list.

Mode

Gets or sets the way the items will be loaded

PageSize

Gets or sets the number of items that will be fetch per page.

SortDescriptions

Gets the sort descriptions applied to the data.

Methods

Name Description
CanFilter(FilterExpression?)

Returns whether the collection is able to filter the specified filterExpression.

CanInsert(int, T)

Determines whether a new item can be inserted in the collection at the specified index.

CanMove(int, int)

Determines whether the item at fromIndex can be moved to toIndex.

CanRefresh()

Determines whether the collection can be refreshed.

CanRemove(int)

Determines whether the item at the specified index can be removed from the collection.

CanReplace(int, T)

Determines whether the item at the specified index can be replaced in the collection.

CanSort(params SortDescription[])

Returns whether the collection is able to sort the specified sortDescriptions.

ConnectAsync(CancellationToken)

Connects the collection to the source.

ConnectAsyncOverride(CancellationToken)

When overridden, this method is used to initialize the collection.

DisconnectAsync(CancellationToken)

Invokes the finalization of the collection.

DisconnectAsyncOverride(CancellationToken)

When overridden, this method is used to finalize the collection.

FilterAsync(FilterExpression?, CancellationToken)

Filters the data using specified filterExpression.

GetLoadedItems()

Returns the items that has be loaded so far.

GetLoadedItems(int?, int?)

Returns all the items that has be loaded so far.

GetPageAsync(int, int, int, IReadOnlyList<SortDescription>?, FilterExpression?, CancellationToken)

When overridden in an inherited class it returns the items in the page as well as a token to the next page.

IndexOf(T?)

Gets the index of the specified item.

InsertAsync(int, T, CancellationToken)

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

InsertAsyncOverride(int, T, CancellationToken)

This method is called when an item is inserted in the collection.

LoadAsync(int?, int?, CancellationToken)

Loads all the items between the specified range.

MoveAsync(int, int, CancellationToken)

Moves an item from the specified fromIndex to toIndex.

MoveAsyncOverride(int, int, CancellationToken)

This method is called when an item is moved in the collection.

OnFilterChanged()

Called after the filter changed.

OnResetting()

Called before the cache is reset.

OnSortChanged()

Called after the sort changed.

RefreshAsync(CancellationToken)

Removes the cached data and loads the whole collection from scratch.

RemoveAsync(int, CancellationToken)

Removes the item at the specified index from the collection.

RemoveAsyncOverride(int, CancellationToken)

This method is called when an item is removed from the collection.

ReplaceAsync(int, T, CancellationToken)

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

ReplaceAsyncOverride(int, T, CancellationToken)

This method is called when an item is replaced in the collection.

ResetCache(int)

Resets the internal cache.

SortAsync(params SortDescription[])

Sorts the collection according to the specified sort descriptions.

SortAsync(SortDescription[], CancellationToken)

Sorts the collection according to the specified sort descriptions.

Events

Name Description
FilterChanged

Raised after a filter operation was performed.

SortChanged

Raised after a sort operation was performed.

Extension Methods