[]
        
(Showing Draft Content)

C1.DataCollection.C1CursorDataCollection-2

C1CursorDataCollection<T, K> Class

Base class for cursor-like collection.

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

The type of the items in the collection.

K

The type of the token.

Remarks

This class is appropriate for wrapping data services that return the data in pages and give a token to get the next page, like Facebook, Twitter, YouTube, etc.

Constructors

Name Description
C1CursorDataCollection()

Properties

Name Description
ConnectionState

Gets the state of the connection to the source.

FilterExpression

Gets the filter expression applied to the data.

HasMoreItems

Gets a value that indicates whether more items can be loaded.

InternalList

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

IsVirtualizing

Gets whether the collection is virtualizing its data.

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)

Disconnects the collection from the source.

DisconnectAsyncOverride(CancellationToken)

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

FilterAsync(FilterExpression?, CancellationToken)

Filters the data using specified filterExpression.

GetPageAsync(int, K?, 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.

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.

LoadMoreItemsAsync(int?, CancellationToken)

Loads more items.

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.

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.

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