Sakura.AspNetCore.Extensions/Sakura.AspNetCore.Mvc.PagedList/Internal/DefaultPagerRenderingListGenerator.cs
/// <summary>
///     Get the rendering state of the current pager item.
/// </summary>
/// <param name="context">The pager item generation context.</param>
/// <returns>The rendering item of the current pager item.</returns>
Get the rendering state of the current pager item.
Get the rendering state of the current pager item .
private PagerRenderingItemState GetRenderingItemState(PagerItemGenerationContext context)
		{
			switch (context.PagerItem.ItemType)
			{
				case PagerItemType.First:
				case PagerItemType.Last:
				case PagerItemType.Previous:
				case PagerItemType.Next:
					var disabled = ItemShouldBeDisabled(context);
					if (!disabled)
						return PagerRenderingItemState.Normal;
					switch (context.PagerItemOptions.InactiveBehavior)
					{
						case SpecialPagerItemInactiveBehavior.Disable:
							return PagerRenderingItemState.Disabled;
						case SpecialPagerItemInactiveBehavior.Hide:
							return PagerRenderingItemState.Hidden;
						default:
							throw new InvalidOperationException(
								$"The value of '{nameof(context.PagerItemOptions.InactiveBehavior)}' property cannot be a valid enum item for a pager item of type '{context.PagerItem.ItemType}'.");
					}
				case PagerItemType.Current:
					return PagerRenderingItemState.Active;
				default:
					return PagerRenderingItemState.Normal;
			}
		}
private PagerRenderingItemState GetRenderingItemState ( PagerItemGenerationContext context ) { switch ( context . PagerItem . ItemType ) { case PagerItemType . First : case PagerItemType . Last : case PagerItemType . Previous : case PagerItemType . Next : var disabled = ItemShouldBeDisabled ( context ) ; if ( ! disabled ) return PagerRenderingItemState . Normal ; switch ( context . PagerItemOptions . InactiveBehavior ) { case SpecialPagerItemInactiveBehavior . Disable : return PagerRenderingItemState . Disabled ; case SpecialPagerItemInactiveBehavior . Hide : return PagerRenderingItemState . Hidden ; default : throw new InvalidOperationException ( $" The value of ' { nameof ( context . PagerItemOptions . InactiveBehavior ) } ' property cannot be a valid enum item for a pager item of type ' { context . PagerItem . ItemType } '. " ) ; } case PagerItemType . Current : return PagerRenderingItemState . Active ; default : return PagerRenderingItemState . Normal ; } }
Get the rendering state of the current pager item.
Get the rendering state of the current pager item .
The rendering item of the current pager item.
The rendering item of the current pager item .
context
PagerItemGenerationContext
The pager item generation context.
The pager item generation context .