Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Mvc.PagedList/Internal/DefaultPagerListGenerator.cs
/// <summary>
///     Generate pager items for the specified layout element.
/// </summary>
/// <param name="element">The layout element to generating the pager items.</param>
/// <param name="currentPage">The current page number.</param>
/// <param name="totalPage">The count of total pages.</param>
/// <param name="options">The options of the pager.</param>
/// <returns>The generated all pager items collection for the specified <paramref name="element" />.</returns>
/// <exception cref="ArgumentException">The <paramref name="element" /> is not a valid enum item.</exception>
Generate pager items for the specified layout element.
Generate pager items for the specified layout element .
private IEnumerable<PagerItem> GenerateItemsForLayoutElement(PagerLayoutElement element, int currentPage,
			int totalPage, PagerOptions options)
		{
			switch (element)
			{
				case PagerLayoutElement.Items:
					return GeneratePagerNormalItems(currentPage, totalPage, options.ExpandPageItemsForCurrentPage,
						options.PagerItemsForEndings);
				case PagerLayoutElement.GoToFirstPageButton:
				case PagerLayoutElement.GoToLastPageButton:
				case PagerLayoutElement.GoToNextPageButton:
				case PagerLayoutElement.GoToPreviousPageButton:
					return new[] {GenerateSpecialItems(currentPage, totalPage, element)};
				default:
					throw new ArgumentException("The value of the argument is not a valid enum item.", nameof(element));
			}
		}
private IEnumerable < PagerItem > GenerateItemsForLayoutElement ( PagerLayoutElement element , int currentPage , int totalPage , PagerOptions options ) { switch ( element ) { case PagerLayoutElement . Items : return GeneratePagerNormalItems ( currentPage , totalPage , options . ExpandPageItemsForCurrentPage , options . PagerItemsForEndings ) ; case PagerLayoutElement . GoToFirstPageButton : case PagerLayoutElement . GoToLastPageButton : case PagerLayoutElement . GoToNextPageButton : case PagerLayoutElement . GoToPreviousPageButton : return new [ ] { GenerateSpecialItems ( currentPage , totalPage , element ) } ; default : throw new ArgumentException ( " " , nameof ( element ) ) ; } }
Generate pager items for the specified layout element.
Generate pager items for the specified layout element .
The generated all pager items collection for the specified .
The generated all pager items collection for the specified .
The  is not a valid enum item.
The is not a valid enum item .
element
PagerLayoutElement
The layout element to generating the pager items.
The layout element to generating the pager items .
currentPage
int
The current page number.
The current page number .
totalPage
int
The count of total pages.
The count of total pages .
options
PagerOptions
The options of the pager.
The options of the pager .