C# Class MvcPaging.PagerOptionsBuilder

Pager options builder class. Enables a fluent interface for adding options to the pager.
Show file Open project: martijnboland/MvcPaging

Protected Properties

Property Type Description
pagerOptions PagerOptions

Public Methods

Method Description
Action ( string action ) : PagerOptionsBuilder

Set the action name for the pager links. Note that we're always using the current controller.

AddRouteValue ( string name, object value ) : PagerOptionsBuilder

Add a custom route value parameter for the pager links.

AlwaysAddFirstPageNumber ( ) : PagerOptionsBuilder

Always add the page number to the generated link for the first page.

By default we don't add the page number for page 1 because it results in canonical links. Use this option to override this behaviour.

DisplayFirstAndLastPage ( ) : PagerOptionsBuilder

Displays both first and last navigation pages.

DisplayFirstPage ( ) : PagerOptionsBuilder

Displays the first navigation page but not the last.

DisplayLastPage ( ) : PagerOptionsBuilder

Displays the last navigation page but not the first.

DisplayTemplate ( string displayTemplate ) : PagerOptionsBuilder

Set the name of the DisplayTemplate view to use for rendering.

The view must have a model of IEnumerable<PaginationModel>

HidePreviousAndNextPage ( ) : PagerOptionsBuilder
MaxNrOfPages ( int maxNrOfPages ) : PagerOptionsBuilder

Set the maximum number of pages to show. The default is 10.

PageRouteValueKey ( string pageRouteValueKey ) : PagerOptionsBuilder

Set the page routeValue key for pagination links

PagerOptionsBuilder ( PagerOptions pagerOptions ) : System
RouteValues ( RouteValueDictionary routeValues ) : PagerOptionsBuilder

Set custom route value parameters for the pager links.

RouteValues ( object routeValues ) : PagerOptionsBuilder

Set custom route value parameters for the pager links.

SetFirstPageText ( string firstPageText ) : PagerOptionsBuilder

Set the text for first page navigation.

SetFirstPageTitle ( string firstPageTitle ) : PagerOptionsBuilder

Set the title for first page navigation.

SetLastPageText ( string lastPageText ) : PagerOptionsBuilder

Set the text for last page navigation.

SetLastPageTitle ( string lastPageTitle ) : PagerOptionsBuilder

Set the title for last page navigation.

SetNextPageText ( string nextPageText ) : PagerOptionsBuilder

Set the text for next page navigation.

SetNextPageTitle ( string nextPageTitle ) : PagerOptionsBuilder

Set the title for next page navigation.

SetPreviousPageText ( string previousPageText ) : PagerOptionsBuilder

Set the text for previous page navigation.

SetPreviousPageTitle ( string previousPageTitle ) : PagerOptionsBuilder

Set the title for previous page navigation.

UseItemCountAsPageCount ( ) : PagerOptionsBuilder

Indicate that the total item count means total page count. This option is for scenario's where certain backends don't return the number of total items, but the number of pages.

Private Methods

Method Description
AjaxOptions ( System.Web.Mvc.Ajax.AjaxOptions ajaxOptions ) : PagerOptionsBuilder

Set the AjaxOptions.

Method Details

Action() public method

Set the action name for the pager links. Note that we're always using the current controller.
public Action ( string action ) : PagerOptionsBuilder
action string
return PagerOptionsBuilder

AddRouteValue() public method

Add a custom route value parameter for the pager links.
public AddRouteValue ( string name, object value ) : PagerOptionsBuilder
name string
value object
return PagerOptionsBuilder

AlwaysAddFirstPageNumber() public method

Always add the page number to the generated link for the first page.
By default we don't add the page number for page 1 because it results in canonical links. Use this option to override this behaviour.
public AlwaysAddFirstPageNumber ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

DisplayFirstAndLastPage() public method

Displays both first and last navigation pages.
public DisplayFirstAndLastPage ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

DisplayFirstPage() public method

Displays the first navigation page but not the last.
public DisplayFirstPage ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

DisplayLastPage() public method

Displays the last navigation page but not the first.
public DisplayLastPage ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

DisplayTemplate() public method

Set the name of the DisplayTemplate view to use for rendering.
The view must have a model of IEnumerable<PaginationModel>
public DisplayTemplate ( string displayTemplate ) : PagerOptionsBuilder
displayTemplate string
return PagerOptionsBuilder

HidePreviousAndNextPage() public method

public HidePreviousAndNextPage ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

MaxNrOfPages() public method

Set the maximum number of pages to show. The default is 10.
public MaxNrOfPages ( int maxNrOfPages ) : PagerOptionsBuilder
maxNrOfPages int
return PagerOptionsBuilder

PageRouteValueKey() public method

Set the page routeValue key for pagination links
public PageRouteValueKey ( string pageRouteValueKey ) : PagerOptionsBuilder
pageRouteValueKey string
return PagerOptionsBuilder

PagerOptionsBuilder() public method

public PagerOptionsBuilder ( PagerOptions pagerOptions ) : System
pagerOptions PagerOptions
return System

RouteValues() public method

Set custom route value parameters for the pager links.
public RouteValues ( RouteValueDictionary routeValues ) : PagerOptionsBuilder
routeValues RouteValueDictionary
return PagerOptionsBuilder

RouteValues() public method

Set custom route value parameters for the pager links.
public RouteValues ( object routeValues ) : PagerOptionsBuilder
routeValues object
return PagerOptionsBuilder

SetFirstPageText() public method

Set the text for first page navigation.
public SetFirstPageText ( string firstPageText ) : PagerOptionsBuilder
firstPageText string
return PagerOptionsBuilder

SetFirstPageTitle() public method

Set the title for first page navigation.
public SetFirstPageTitle ( string firstPageTitle ) : PagerOptionsBuilder
firstPageTitle string
return PagerOptionsBuilder

SetLastPageText() public method

Set the text for last page navigation.
public SetLastPageText ( string lastPageText ) : PagerOptionsBuilder
lastPageText string
return PagerOptionsBuilder

SetLastPageTitle() public method

Set the title for last page navigation.
public SetLastPageTitle ( string lastPageTitle ) : PagerOptionsBuilder
lastPageTitle string
return PagerOptionsBuilder

SetNextPageText() public method

Set the text for next page navigation.
public SetNextPageText ( string nextPageText ) : PagerOptionsBuilder
nextPageText string
return PagerOptionsBuilder

SetNextPageTitle() public method

Set the title for next page navigation.
public SetNextPageTitle ( string nextPageTitle ) : PagerOptionsBuilder
nextPageTitle string
return PagerOptionsBuilder

SetPreviousPageText() public method

Set the text for previous page navigation.
public SetPreviousPageText ( string previousPageText ) : PagerOptionsBuilder
previousPageText string
return PagerOptionsBuilder

SetPreviousPageTitle() public method

Set the title for previous page navigation.
public SetPreviousPageTitle ( string previousPageTitle ) : PagerOptionsBuilder
previousPageTitle string
return PagerOptionsBuilder

UseItemCountAsPageCount() public method

Indicate that the total item count means total page count. This option is for scenario's where certain backends don't return the number of total items, but the number of pages.
public UseItemCountAsPageCount ( ) : PagerOptionsBuilder
return PagerOptionsBuilder

Property Details

pagerOptions protected property

protected PagerOptions pagerOptions
return PagerOptions