Table of Contents

Class PaginationEnumerable<T>

Namespace
Cuemon.Collections.Generic
Assembly
Cuemon.Core.dll

Represents a generic and read-only pagination sequence.

public class PaginationEnumerable<T> : IEnumerable<T>, IEnumerable

Type Parameters

T

The type of elements in the collection.

Inheritance
PaginationEnumerable<T>
Implements
Derived

Constructors

PaginationEnumerable(IEnumerable<T>, Func<Int32>, Action<PaginationOptions>)

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

public PaginationEnumerable(IEnumerable<T> source, Func<int> totalElementCounter, Action<PaginationOptions> setup = null)

Parameters

source IEnumerable<T>

The sequence to turn into a page.

totalElementCounter Func<Int32>

The total element counter.

setup Action<PaginationOptions>

The PaginationOptions which may be configured.

Properties

FirstPage

Gets a value indicating whether this instance is on the first paged data sequence.

public bool FirstPage { get; }

Property Value

Boolean

true if this instance is on the first paged data sequence; otherwise, false.

HasNextPage

Gets a value indicating whether this instance has a next paged data sequence.

public bool HasNextPage { get; }

Property Value

Boolean

true if this instance has a next paged data sequence; otherwise, false.

HasPreviousPage

Gets a value indicating whether this instance has a previous paged data sequence.

public bool HasPreviousPage { get; }

Property Value

Boolean

true if this instance has a previous paged data sequence; otherwise, false.

LastPage

Gets a value indicating whether this instance is on the last paged data sequence.

public bool LastPage { get; }

Property Value

Boolean

true if this instance is on the last paged data sequence; otherwise, false.

PageCount

Gets the total amount of pages for the elements in this sequence.

public int PageCount { get; }

Property Value

Int32

The total amount of pages for the elements in this sequence.

PageSource

Gets the page source of this instance.

protected IEnumerable<T> PageSource { get; }

Property Value

IEnumerable<T>

The page source of this instance.

TotalElementCount

Gets the total number of elements in the sequence before paging is applied.

public int TotalElementCount { get; }

Property Value

Int32

The total number of elements in the sequence before paging is applied.

Methods

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>

An enumerator that can be used to iterate through the collection.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

IEnumerator IEnumerable.GetEnumerator()

Returns

IEnumerator

See Also