Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Mvc.PagedList/Internal/DefaultPagerRenderingListGenerator.cs
/// <summary>
///     Get a value that indicates whether the current pager item should be disabled.
/// </summary>
/// <param name="context">The pager item generation context.</param>
/// <returns>If the current pager item should be disabled, returns <c>true</c>; otherwise returns <c>false</c>.</returns>
Get a value that indicates whether the current pager item should be disabled.
Get a value that indicates whether the current pager item should be disabled .
private bool ItemShouldBeDisabled(PagerItemGenerationContext context)
		{
			switch (context.PagerItem.ItemType)
			{
				case PagerItemType.First:
				case PagerItemType.Last:
					switch (context.PagerItemOptions.ActiveMode)
					{
						case FirstAndLastPagerItemActiveMode.Always:
							return false;
						case FirstAndLastPagerItemActiveMode.NotInCurrentPage:
							return context.CurrentPage == context.PagerItem.PageNumber;
						case FirstAndLastPagerItemActiveMode.NotInVisiblePageList:
							return IsPageVisible(context);
						default:
							throw new InvalidOperationException(
								$"The value of '{nameof(context.PagerItemOptions.ActiveMode)}' property cannot be a valid enum item for a pager item of type '{context.PagerItem.ItemType}'.");
					}
				case PagerItemType.Next:
					return context.CurrentPage == context.TotalPage;
				case PagerItemType.Previous:
					return context.CurrentPage == 1;
				default:
					return false;
			}
		}
private bool ItemShouldBeDisabled ( PagerItemGenerationContext context ) { switch ( context . PagerItem . ItemType ) { case PagerItemType . First : case PagerItemType . Last : switch ( context . PagerItemOptions . ActiveMode ) { case FirstAndLastPagerItemActiveMode . Always : return false ; case FirstAndLastPagerItemActiveMode . NotInCurrentPage : return context . CurrentPage == context . PagerItem . PageNumber ; case FirstAndLastPagerItemActiveMode . NotInVisiblePageList : return IsPageVisible ( context ) ; default : throw new InvalidOperationException ( $" The value of ' { nameof ( context . PagerItemOptions . ActiveMode ) } ' property cannot be a valid enum item for a pager item of type ' { context . PagerItem . ItemType } '. " ) ; } case PagerItemType . Next : return context . CurrentPage == context . TotalPage ; case PagerItemType . Previous : return context . CurrentPage == 1 ; default : return false ; } }
Get a value that indicates whether the current pager item should be disabled.
Get a value that indicates whether the current pager item should be disabled .
If the current pager item should be disabled, returns truefalse
If the current pager item should be disabled returns truefalse
context
PagerItemGenerationContext
The pager item generation context.
The pager item generation context .