• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PagerOptions类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PagerOptions的典型用法代码示例。如果您正苦于以下问题:C# PagerOptions类的具体用法?C# PagerOptions怎么用?C# PagerOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PagerOptions类属于命名空间,在下文中一共展示了PagerOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PagerBuilder

 internal PagerBuilder(HtmlHelper html, AjaxHelper ajax, string actionName, string controllerName,
     int totalPageCount, int pageIndex, PagerOptions pagerOptions, string routeName, RouteValueDictionary routeValues,
     MvcAjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)
 {
     _ajaxPagingEnabled = (ajax != null);
     if (pagerOptions == null)
         pagerOptions = new PagerOptions();
     _html = html;
     _ajax = ajax;
     _actionName = actionName;
     _controllerName = controllerName;
     if (pagerOptions.MaxPageIndex == 0 || pagerOptions.MaxPageIndex > totalPageCount)
         _totalPageCount = totalPageCount;
     else
         _totalPageCount = pagerOptions.MaxPageIndex;
     _pageIndex = pageIndex;
     _pagerOptions = pagerOptions;
     _routeName = routeName;
     _routeValues = routeValues;
     _ajaxOptions = ajaxOptions;
     _htmlAttributes = htmlAttributes;
     // start page index
     _startPageIndex = pageIndex - (pagerOptions.NumericPagerItemCount / 2);
     if (_startPageIndex + pagerOptions.NumericPagerItemCount > _totalPageCount)
         _startPageIndex = _totalPageCount + 1 - pagerOptions.NumericPagerItemCount;
     if (_startPageIndex < 1)
         _startPageIndex = 1;
     // end page index
     _endPageIndex = _startPageIndex + _pagerOptions.NumericPagerItemCount - 1;
     if (_endPageIndex > _totalPageCount)
         _endPageIndex = _totalPageCount;
 }
开发者ID:jasonoiu,项目名称:OIU.CorporateWebsite,代码行数:32,代码来源:PagerBuilder.cs


示例2: PagerBuilder

        internal PagerBuilder(HtmlHelper helper, string actionName, string controllerName, int totalPageCount, int pageIndex, PagerOptions options, object values)
        {
            // Set defaults
            if (String.IsNullOrEmpty(actionName))
                actionName = (string)helper.ViewContext.RouteData.Values["action"];
            if (String.IsNullOrEmpty(controllerName))
                controllerName = (string)helper.ViewContext.RouteData.Values["controller"];
            if (options == null)
                options = new PagerOptions();

            // Assign to fields
            _helper = helper;
            _actionName = actionName;
            _controllerName = controllerName;
            _totalPageCount = totalPageCount;
            _pageIndex = pageIndex;
            _options = options;
            _values = values;

            // Calculate start page index
            _startPageIndex = pageIndex - (options.MaximumPageNumbers / 2);
            if (_startPageIndex + options.MaximumPageNumbers > _totalPageCount)
                _startPageIndex = _totalPageCount - options.MaximumPageNumbers;
            if (_startPageIndex < 0)
                _startPageIndex = 0;

            // Calculate end page index
            _endPageIndex = _startPageIndex + _options.MaximumPageNumbers;
            if (_endPageIndex > _totalPageCount)
                _endPageIndex = _totalPageCount;
        }
开发者ID:listentorick,项目名称:ListenTo,代码行数:31,代码来源:PagerBuilder.cs


示例3: PagerBuilder

        //Ajax pager builder
        internal PagerBuilder(AjaxHelper ajaxHelper, int totalPageCount, int pageIndex, PagerOptions pagerOptions,
            MvcAjaxOptions ajaxOptions)
        {
            _ajaxPagingEnabled =true;
            if (ajaxHelper == null)
            {
                throw new ArgumentNullException("ajaxHelper");
            }
            if (pagerOptions == null)
                pagerOptions = new PagerOptions();
            _ajax = ajaxHelper;
            if (pagerOptions.MaximumPageNumber == 0 || pagerOptions.MaximumPageNumber > totalPageCount)
                _totalPageCount = totalPageCount;
            else
                _totalPageCount = pagerOptions.MaximumPageNumber;
            _pageIndex = pageIndex;
            _pagerOptions = pagerOptions;
            _ajaxOptions = ajaxOptions ?? new MvcAjaxOptions();

            // start page index
            _startPageIndex = pageIndex - (pagerOptions.NumericPagerItemCount / 2);
            if (_startPageIndex + pagerOptions.NumericPagerItemCount > _totalPageCount)
                _startPageIndex = _totalPageCount + 1 - pagerOptions.NumericPagerItemCount;
            if (_startPageIndex < 1)
                _startPageIndex = 1;

            // end page index
            _endPageIndex = _startPageIndex + _pagerOptions.NumericPagerItemCount - 1;
            if (_endPageIndex > _totalPageCount)
                _endPageIndex = _totalPageCount;
        }
开发者ID:wlclass,项目名称:MvcPager,代码行数:32,代码来源:PagerBuilder.cs


示例4: AjaxPager

 public static MvcHtmlString AjaxPager(this HtmlHelper html, IPagedList pagedList, PagerOptions pagerOptions, AjaxOptions ajaxOptions)
 {
     if (pagedList == null)
         return AjaxPager(html, pagerOptions, null);
     return AjaxPager(html, pagedList.TotalItemCount, pagedList.PageSize, pagedList.CurrentPageIndex, null, null, null, pagerOptions, null, ajaxOptions,
                      null);
 }
开发者ID:JPomichael,项目名称:IPOW,代码行数:7,代码来源:PagerHelper.cs


示例5: Pager

 ///<include file='MvcPagerDocs.xml' path='MvcPagerDocs/PagerExtensions/Method[@name="HtmlPager4"]/*'/>
 public static HtmlPager Pager(this HtmlHelper helper, IPagedList pagedList, PagerOptions pagerOptions)
 {
     if (pagedList == null)
     {
         throw new ArgumentNullException("pagedList");
     }
     return Pager(helper, pagedList.TotalItemCount, pagedList.PageSize, pagedList.CurrentPageIndex, pagerOptions);
 }
开发者ID:wlclass,项目名称:MvcPager,代码行数:9,代码来源:PagerExtensions.cs


示例6: AjaxPager

 public static MvcHtmlString AjaxPager(this HtmlHelper html, IPagedList pagedList, string actionName, string controllerName, PagerOptions pagerOptions, AjaxOptions ajaxOptions)
 {
     if (pagedList == null)
     {
         return AjaxPager(html, pagerOptions, null);
     }
     return html.AjaxPager(pagedList.TotalItemCount, pagedList.PageSize, pagedList.CurrentPageIndex, actionName, controllerName, null, pagerOptions, ((RouteValueDictionary)null), ajaxOptions, ((IDictionary<string, object>)null));
 }
开发者ID:HelloAmy,项目名称:01component,代码行数:8,代码来源:PagerHelper.cs


示例7: Pager

 public Pager(HtmlHelper htmlHelper, int pageSize, int currentPage, int totalItemCount)
 {
     this.htmlHelper = htmlHelper;
     this.pageSize = pageSize;
     this.currentPage = currentPage;
     this.totalItemCount = totalItemCount;
     this.pagerOptions = new PagerOptions();
 }
开发者ID:edokan,项目名称:MvcPaging,代码行数:8,代码来源:Pager.cs


示例8: HtmlPager

 ///<include file='MvcPagerDocs.xml' path='MvcPagerDocs/HtmlPager/Constructor[@name="HtmlPager1"]/*'/>
 public HtmlPager(HtmlHelper html, int totalItemCount, int pageSize, int pageIndex,PagerOptions pagerOptions)
 {
     _htmlHelper = html;
     _totalItemCount = totalItemCount;
     _pageSize = pageSize;
     _currentPageIndex = pageIndex;
     _pagerOptions = pagerOptions;
 }
开发者ID:wlclass,项目名称:MvcPager,代码行数:9,代码来源:HtmlPager.cs


示例9: Pager

 public Pager(HtmlHelper htmlHelper, int pageSize, int currentPage, int totalItemCount)
 {
     _htmlHelper = htmlHelper;
     _pageSize = pageSize;
     _currentPage = currentPage;
     _totalItemCount = totalItemCount;
     PagerOptions = new PagerOptions();
 }
开发者ID:Nuke777,项目名称:Architecture,代码行数:8,代码来源:Pager.cs


示例10: PagerBuilder

 /// <summary>
 /// Used when PagedList is null
 /// </summary>
 internal PagerBuilder(HtmlHelper html, PagerOptions pagerOptions, IDictionary<string, object> htmlAttributes)
 {
     if (pagerOptions == null)
         pagerOptions = new PagerOptions();
     _html = html;
     _pagerOptions = pagerOptions;
     _htmlAttributes = htmlAttributes;
 }
开发者ID:Kitsula,项目名称:MvcAjaxPager,代码行数:11,代码来源:PagerBuilder.cs


示例11: AjaxPager

 ///<include file='MvcPagerDocs.xml' path='MvcPagerDocs/AjaxPager/Constructor[@name="AjaxPager1"]/*'/>
 public AjaxPager(AjaxHelper ajax, int totalItemCount, int pageSize, int pageIndex,PagerOptions pagerOptions, MvcAjaxOptions ajaxOptions)
 {
     _ajaxHelper = ajax;
     _totalItemCount = totalItemCount;
     _pageSize = pageSize;
     _currentPageIndex = pageIndex;
     _pagerOptions = pagerOptions;
     _ajaxOptions = ajaxOptions;
 }
开发者ID:wlclass,项目名称:MvcPager,代码行数:10,代码来源:AjaxPager.cs


示例12: Options

 ///<include file='MvcPagerDocs.xml' path='MvcPagerDocs/HtmlPager/Method[@name="Options"]/*'/>
 public HtmlPager Options(Action<PagerOptionsBuilder> builder)
 {
     if (_pagerOptions == null)
     {
         _pagerOptions = new PagerOptions();
     }
     builder(new PagerOptionsBuilder(_pagerOptions));
     return this;
 }
开发者ID:wlclass,项目名称:MvcPager,代码行数:10,代码来源:HtmlPager.cs


示例13: PagerBuilder

 /// <summary>
 /// used when PagedList is null
 /// </summary>
 public PagerBuilder(HtmlHelper html, AjaxHelper ajax, PagerOptions pagerOptions, IDictionary<string, object> htmlAttributes)
 {
     if (pagerOptions == null)
         pagerOptions = new PagerOptions();
     _html = html;
     _ajax = ajax;
     _pagerOptions = pagerOptions;
     _htmlAttributes = htmlAttributes;
 }
开发者ID:Godoy,项目名称:CMS,代码行数:12,代码来源:PagerBuilder.cs


示例14: AjaxPager

        public static MvcHtmlString AjaxPager(this HtmlHelper html, int totalItemCount, int pageSize, int pageIndex, string actionName, string controllerName,
			string routeName, PagerOptions pagerOptions, RouteValueDictionary routeValues, IDictionary<string, object> htmlAttributes)
        {
            if (pagerOptions == null)
                pagerOptions = new PagerOptions();

            var totalPageCount = (int)Math.Ceiling(totalItemCount / (double)pageSize);
            var builder = new PagerBuilder(html, actionName, controllerName, totalPageCount, pageIndex, pagerOptions, routeName, routeValues, htmlAttributes);
            return builder.RenderPager();
        }
开发者ID:Kitsula,项目名称:MvcAjaxPager,代码行数:10,代码来源:PagerHelper.cs


示例15: AjaxPager

        public static MvcHtmlString AjaxPager(this HtmlHelper html, int totalItemCount, int pageSize, int pageIndex, string actionName, string controllerName,
            string routeName, PagerOptions pagerOptions, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes)
        {
            if(pagerOptions == null)
                pagerOptions = new PagerOptions();
            pagerOptions.UseJqueryAjax = true;

            var totalPageCount = (int) Math.Ceiling(totalItemCount/(double) pageSize);
            var builder = new PagerBuilder(html, actionName, controllerName, totalPageCount, pageIndex, totalItemCount, pagerOptions,
                routeName, new RouteValueDictionary(routeValues), ajaxOptions, new RouteValueDictionary(htmlAttributes));
            return builder.RenderPager();
        }
开发者ID:liuyouying,项目名称:MVC,代码行数:12,代码来源:PagerHelper.cs


示例16: PagerGenerationContext

		/// <summary>
		///     Initialize a new instance.
		/// </summary>
		/// <param name="currentPage">The current page number in the pager.</param>
		/// <param name="totalPage">The total page count of the pager.</param>
		/// <param name="options">The options of the pager.</param>
		/// <param name="viewContext">The current view context.</param>
		/// <param name="generationMode">The generation mode.</param>
		public PagerGenerationContext(
			int currentPage,
			int totalPage,
			PagerOptions options,
			ViewContext viewContext,
			PagerGenerationMode generationMode)
		{
			Options = options;
			ViewContext = viewContext;
			GenerationMode = generationMode;
			CurrentPage = currentPage;
			TotalPage = totalPage;
			GenerationMode = generationMode;
		}
开发者ID:sgjsakura,项目名称:AspNetCore,代码行数:22,代码来源:PagerGenerationContext.cs


示例17: PagerBuilder

        internal PagerBuilder(HtmlHelper html, AjaxHelper ajax, string actionName, string controllerName,
            int totalPageCount, int pageIndex, int totalItemCount, PagerOptions pagerOptions, string routeName, RouteValueDictionary routeValues,
            AjaxOptions ajaxOptions, IDictionary<string, object> htmlAttributes)
        {
            _msAjaxPaging = (ajax != null);
            if (String.IsNullOrEmpty(actionName))
            {
                if (ajax != null)
                    actionName = (string)ajax.ViewContext.RouteData.Values["action"];
                else
                    actionName = (string)html.ViewContext.RouteData.Values["action"];
            }
            if (String.IsNullOrEmpty(controllerName))
            {
                if (ajax != null)
                    controllerName = (string)ajax.ViewContext.RouteData.Values["controller"];
                else
                    controllerName = (string)html.ViewContext.RouteData.Values["controller"];
            }
            if (pagerOptions == null)
                pagerOptions = new PagerOptions();

            _html = html;
            _ajax = ajax;
            _actionName = actionName;
            _controllerName = controllerName;
            if (pagerOptions.MaxPageIndex == 0 || pagerOptions.MaxPageIndex > totalPageCount)
                _totalPageCount = totalPageCount;
            else
                _totalPageCount = pagerOptions.MaxPageIndex;
            _pageIndex = pageIndex;
            _totalItemCount = totalItemCount;
            _pagerOptions = pagerOptions;
            _routeName = routeName;
            _routeValues = routeValues;
            _ajaxOptions = ajaxOptions;
            _htmlAttributes = htmlAttributes;

            // start page index
            _startPageIndex = pageIndex - (pagerOptions.NumericPagerItemCount / 2);
            if (_startPageIndex + pagerOptions.NumericPagerItemCount > _totalPageCount)
                _startPageIndex = _totalPageCount + 1 - pagerOptions.NumericPagerItemCount;
            if (_startPageIndex < 1)
                _startPageIndex = 1;

            // end page index
            _endPageIndex = _startPageIndex + _pagerOptions.NumericPagerItemCount - 1;
            if (_endPageIndex > _totalPageCount)
                _endPageIndex = _totalPageCount;
        }
开发者ID:chunlei,项目名称:QrF,代码行数:50,代码来源:PagerBuilder.cs


示例18: PagerBuilder

 // Methods
 internal PagerBuilder(HtmlHelper html, AjaxHelper ajax, PagerOptions pagerOptions, IDictionary<string, object> htmlAttributes)
 {
     this.totalPageCountGang = 1;
     this.startPageIndexGang = 1;
     this.endPageIndex = 1;
     if (pagerOptions == null)
     {
         pagerOptions = new PagerOptions();
     }
     this.htmlGang = html;
     this.ajaxGang = ajax;
     this.pagerOpitonGang = pagerOptions;
     this.htmlAttributesGang = htmlAttributes;
 }
开发者ID:HelloAmy,项目名称:01component,代码行数:15,代码来源:PagerBuilder.cs


示例19: Pager

 public static MvcHtmlString Pager(this HtmlHelper helper, int TotalCount, int pageSize, int pageIndex, string actionName, string controllerName,
     PagerOptions pagerOptions, string routeName, object routeValues, object htmlAttributes)
 {
     var totalPageCount = (int)Math.Ceiling(TotalCount / (double)pageSize);
     var builder = new PagerBuilder
         (
             helper,
             actionName,
             controllerName,
             totalPageCount,
             pageIndex,
             pagerOptions,
             routeName,
             new RouteValueDictionary(routeValues),
             new RouteValueDictionary(htmlAttributes)
         );
     return builder.RenderPager();
 }
开发者ID:itabas016,项目名称:AppStores,代码行数:18,代码来源:PagerHelper.cs


示例20: PagerOptionsBuilder

		public PagerOptionsBuilder(PagerOptions pagerOptions)
		{
			this.pagerOptions = pagerOptions;
		}
开发者ID:dsouzaj86,项目名称:MvcPaging,代码行数:4,代码来源:PagerOptionsBuilder.cs



注:本文中的PagerOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PagerRequest类代码示例发布时间:2022-05-24
下一篇:
C# PagerItem类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap