Pagination¶
Namespace:
SideXP.Core
Utility class for pagination system.
Constructors¶
Pagination(int)¶
Class constructor.
Parameters
page: The current page index.
Pagination(int, int)¶
Class constructor.
Parameters
page: The current page index.nbElementsPerPage: The number of elements per page.
Pagination(int, int, int)¶
Class constructor.
Parameters
page: The current page index.nbElementsPerPage: The number of elements displayed per page.nbElements: The number of elements in your paginated ensemble.
Fields¶
DefaultElementsCountPerPage¶
Properties¶
Page¶
Gets/sets the current page index (starting at 0).
PagesCount¶
Gets the number of pages.
ElementsCount¶
Gets/sets the total number of elements.
NbElementsPerPage¶
Gets/sets the number of elements per page.
FirstIndex¶
Gets the first index (inclusive) in the paginated range.
LastIndex¶
Gets the last index (exclusive) in the paginated range.
Methods¶
Paginate<T>(IList<T>, int, int)¶
Creates a sub-list of the given one that contains only the elements in the paginated range.
Type parameters
T: The type of elements in the given list.
Parameters
page: The current page index.nbElementsPerPage: The number of elements per page.list: The list that is paginated.
Returns
Returns the sub-list of the elements to display.
Paginate<T>(IList<T>, Pagination, int, int)¶
public static T[] Paginate<T>(IList<T> list, out Pagination pagination, int page, int nbElementsPerPage = 25)
Parameters
pagination: Outputs the Pagination infos of the operation.page: The current page index.nbElementsPerPage: The number of elements per page.
Paginate<T>(IList<T>)¶
Creates a sub-list of the given one that contains only the elements in the paginated range.
Type parameters
T: The type of elements in the given list.
Parameters
list: The list that is paginated.
Returns
Returns the sub-list of the elements to display.
CountPages<T>(IList<T>, int)¶
Computes the number of pages, given the total number of elements and the number of elements per page.
Type parameters
T: The types of elements in the given list.
Parameters
list: The list that is paginated.nbElementsPerPage: The number of elements displayed per page.
Returns
Returns the computed number of pages.
CountPages(int, int)¶
Computes the number of pages, given the total number of elements and the number of elements per page.
Parameters
elementsCount: The total number of elements.nbElementsPerPage: The number of elements displayed per page.
Returns
Returns the computed number of pages.
operator ==(Pagination, Pagination)¶
Checks if the given Pagination values are equal.
operator !=(Pagination, Pagination)¶
Checks if the given Pagination are different.
operator ++(Pagination)¶
Increment the current page index.
operator --(Pagination)¶
Decrement the current page index.
operator +(Pagination, int)¶
Increment the current page index by the given value.
operator -(Pagination, int)¶
Decrement the current page index by the given value.
Equals(object)¶
Checks if the given object is equal to this Pagination object.
GetHashCode()¶
Gets the hash code of this Pagination object.
ToString()¶
Converts this Pagination object into a string.