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

C# Paging类代码示例

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

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



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

示例1: ActionsForBoardRequest

		public ActionsForBoardRequest(IBoardId board, ISince since, Paging paging, IEnumerable<ActionType> types)
			: base(board, "actions")
		{
			this.AddTypeFilter(types);
			this.AddSince(since);
			this.AddPaging(paging);
		}		
开发者ID:Bunk,项目名称:trellow,代码行数:7,代码来源:ActionsForBoardRequest.cs


示例2: ActionsForMemberRequest

		public ActionsForMemberRequest(IMemberId member, ISince since, Paging paging, IEnumerable<ActionType> filter)
			: base(member, "actions")
		{
			this.AddTypeFilter(filter);
			this.AddSince(since);
			this.AddPaging(paging);
		}
开发者ID:Geniegl,项目名称:Trello.NET,代码行数:7,代码来源:ActionsForMemberRequest.cs


示例3: ActionsForOrganizationRequest

		public ActionsForOrganizationRequest(IOrganizationId organization, ISince since, Paging paging, IEnumerable<ActionType> filter)
			: base(organization, "actions")
		{
			this.AddTypeFilter(filter);
			this.AddSince(since);
			this.AddPaging(paging);
		}
开发者ID:KennyBu,项目名称:Trello.NET,代码行数:7,代码来源:ActionsForOrganizationRequest.cs


示例4: Get_Page

        /// <summary>
        /// 分頁
        /// </summary>
        /// <param name="total">總數量</param>
        /// <param name="current_page">目前頁數</param>
        /// <param name="page_count">單頁數量</param>
        /// <returns>分頁</returns>
        public static Paging Get_Page(int total, int current_page = 1, int page_count = 10, int pages = 5)
        {
            Paging page = new Paging();

            int count = pages;
            int count_com = Convert.ToInt32(Math.Floor((double)count / 2));

            page.First = 1;
            int last = Convert.ToInt32(Math.Ceiling((double)total / (double)page_count));
            page.Last = last <= 0 ? 1 : last;
            page.Total = total;
            page.Now = current_page;

            page.Back = (current_page > 1) ? current_page - 1 : current_page;
            page.Next = (current_page < last) ? current_page + 1 : current_page;

            int start = current_page - count_com;
            page.Start = (start < 1) ? 1 : start;

            int end = page.Start + count - 1;
            end = (end >= last) ? last : end;
            page.End = (end == 0) ? 1 : end;

            return page;
        }
开发者ID:kakaci123,项目名称:Program-Git-Foundation,代码行数:32,代码来源:Method.cs


示例5: ActionsForCardRequest

		public ActionsForCardRequest(ICardId card, ISince since, Paging paging, IEnumerable<ActionType> filter)
			: base(card, "actions")
		{
			this.AddTypeFilter(filter);
			this.AddSince(since);
			this.AddPaging(paging);
		}
开发者ID:Geniegl,项目名称:Trello.NET,代码行数:7,代码来源:ActionsForCardRequest.cs


示例6: Get

        public IEnumerable<Activity> Get(Feed feed, Paging paging)
        {
            SortedSet<Activity> activities = new SortedSet<Activity>(Activity.Comparer);

            foreach (var streamId in feed.Streams)
            {
                var streamIdQuery = Convert.ToBase64String(streamId);

                var prepared = session
                        .Prepare(LoadActivityStreamQueryTemplate)
                        .Bind(streamIdQuery, paging.Timestamp)
                        .SetAutoPage(false)
                        .SetPageSize(paging.Take);

                var rowSet = session.Execute(prepared);
                foreach (var row in rowSet.GetRows())
                {
                    using (var stream = new MemoryStream(row.GetValue<byte[]>("data")))
                    {
                        var storedActivity = (Activity)serializer.Deserialize(stream);
                        activities.Add(storedActivity);
                    }
                }
            }
            return activities.Take(paging.Take);
        }
开发者ID:spardadanthe,项目名称:ActivityStreams,代码行数:26,代码来源:ActivityStore.cs


示例7: NotificationsForMeRequest

		public NotificationsForMeRequest(IMemberId member, IEnumerable<NotificationType> filter, ReadFilter readFilter, Paging paging)
			: base(member, "notifications")
		{
			AddTypeFilter(filter);
			this.AddFilter(readFilter, "read_filter");
			this.AddPaging(paging);
		}
开发者ID:Bunk,项目名称:trellow,代码行数:7,代码来源:NotificationsForMeRequest.cs


示例8: ActionsForListRequest

		public ActionsForListRequest(IListId list, ISince since, Paging paging, IEnumerable<ActionType> filter)
			: base(list, "actions")
		{
			this.AddTypeFilter(filter);
			this.AddSince(since);
			this.AddPaging(paging);
		}
开发者ID:Bunk,项目名称:trellow,代码行数:7,代码来源:ActionsForListRequest.cs


示例9: ProcessRequest

        public void ProcessRequest(HttpContext context)
        {
            this.context = context;
            context.Response.ContentType = "text/json";

            int count;
            List<Employee> result = Employee.GetEmployeesFilter(this.Start, this.Limit, this.Sort, out count);
            Paging<Employee> pagingEmployees = new Paging<Employee>(result, count);

            StoreResponseData sr = new StoreResponseData();
            sr.Total = pagingEmployees.TotalRecords;

            sr.Data = JSON.Serialize(from e in pagingEmployees.Data select new
            {
                  e.Address,
                  e.BirthDate,
                  e.City,
                  e.Country,
                  e.EmployeeID,
                  e.Extension,
                  e.FirstName,
                  e.HireDate,
                  e.HomePhone,
                  e.LastName,
                  e.Notes,
                  e.PhotoPath,
                  e.PostalCode,
                  e.Region,
                  e.ReportsTo,
                  e.Title,
                  e.TitleOfCourtesy
            });

            sr.Return();
        }
开发者ID:extnet,项目名称:Ext.NET.Examples,代码行数:35,代码来源:EmployeesControler.ashx.cs


示例10: DataSelectParameter

		public DataSelectParameter(string fullName, ICondition condition, string scope, Paging paging, Sorting[] sortings) : base(fullName)
		{
			_condition = condition;
			_scope = scope;
			_paging = paging;
			_sortings = sortings;
		}
开发者ID:Zongsoft,项目名称:Zongsoft.Data,代码行数:7,代码来源:DataSelectParameter.cs


示例11: ConstructorToken

		[Test] public void ConstructorToken()
		{
			Paging p = new Paging();
			Assert.AreEqual(string.Format("{0},{1}",int.MaxValue,0),p.Token);
			
			p = new Paging(7,55);
			Assert.AreEqual(string.Format("{0},{1}",55,7),p.Token);
		}
开发者ID:RedwardsiPipeline,项目名称:VersionOne.SDK.NET.APIClient,代码行数:8,代码来源:PagingTester.cs


示例12: AddPaging

		public static void AddPaging(this RestRequest request, Paging paging)
		{
			if (paging == null)
				return;

			request.AddParameter("limit", paging.Limit, ParameterType.GetOrPost);
			request.AddParameter("page", paging.Page, ParameterType.GetOrPost);
		}
开发者ID:kareem613,项目名称:Trello.NET,代码行数:8,代码来源:RestRequestExtensions.cs


示例13: TokenEqualsToString

		[Test] public void TokenEqualsToString()
		{
			Paging p = new Paging(5,25);

			string value = string.Format("{0},{1}",25,5);
			Assert.AreEqual(value,p.Token);
			Assert.AreEqual(value,p.ToString());
		}
开发者ID:RedwardsiPipeline,项目名称:VersionOne.SDK.NET.APIClient,代码行数:8,代码来源:PagingTester.cs


示例14: GetPages

    public static Paging GetPages(int itemCount, int itemsPerPage)
    {
        int page;
        int.TryParse(HttpContext.Current.Request.QueryString["page"], out page);
        if (page == 0) page = 1;

        var pages = new Paging { ItemsPerPage = itemsPerPage, CurrentPage = page, PreviousPage = page - 1, NextPage = page + 1, TotalPages = Math.Ceiling(itemCount / (Double)itemsPerPage), Skip = (page*itemsPerPage) - itemsPerPage, Take = itemsPerPage };
        return pages;
    }
开发者ID:tgdh,项目名称:clearlead,代码行数:9,代码来源:Paging.cs


示例15: SqlSentenceBuilder

 public SqlSentenceBuilder()
 {
     Select = new List<Part>();
     From = new List<FromPart>();
     Where = new List<WherePart>();
     GroupBy = new List<Part>();
     Having = new List<Part>();
     OrderBy = new List<Part>();
     Paging = new Paging();
 }
开发者ID:panicoenlaxbox,项目名称:SqlSentence,代码行数:10,代码来源:SqlSentenceBuilder.cs


示例16: Select

 public virtual Paging<Screen> Select(Search search, int page, int size)
 {
     if (search == null)
         throw new ArgumentNullException("search");
     var query = this.GetQuery(search);
     query = query.OrderByDescending(s => s.CreateTime);
     var metas = new Paging<ScreenMeta>(query, page, size);
     var screens = Mapper.Map<ScreenMeta[], Screen[]>(metas.Data);
     return new Paging<Screen>(screens, metas.PageCount, metas.TotalCount);
 }
开发者ID:HsuStan,项目名称:yavin,代码行数:10,代码来源:ScreenServiceProvider.cs


示例17: Select

 public virtual Paging<CommandLog> Select(Search search, int page, int size)
 {
     if (search == null)
         throw new ArgumentNullException("search");
     var query = this.GetQuery(search);
     query = query.OrderByDescending(l => l.CreateTime);
     var metas = new Paging<CommandLogMeta>(query, page, size);
     var logs = Mapper.Map<CommandLogMeta[], CommandLog[]>(metas.Data);
     return new Paging<CommandLog>(logs, metas.PageCount, metas.TotalCount);
 }
开发者ID:HsuStan,项目名称:yavin,代码行数:10,代码来源:CommandLogServiceProvider.cs


示例18: ChangeToken

		[Test] public void ChangeToken()
		{
			Paging p = new Paging();
			p.PageSize = 12;
			Assert.AreEqual(string.Format("{0},{1}",12,0),p.Token);			
			p.Start = 38;
			Assert.AreEqual(string.Format("{0},{1}",12,38),p.Token);
			p.PageSize = 16;
			p.Start = 3;
			Assert.AreEqual(string.Format("{0},{1}",16,3),p.Token);
		}
开发者ID:RedwardsiPipeline,项目名称:VersionOne.SDK.NET.APIClient,代码行数:11,代码来源:PagingTester.cs


示例19: All

        public string All(FornecedorPesquisa parametros, int totalPerPage, int page)
        {
            var fornecedorRules = new FornecedorRules();

            var paging = new Paging()
            {
                page = page,
                totalPerPage = totalPerPage
            };

            return Success(fornecedorRules.All(parametros, paging), paging);
        }
开发者ID:AguiaSoftware,项目名称:zapweb,代码行数:12,代码来源:FornecedorController.cs


示例20: PagingShouldEmpty

        public void PagingShouldEmpty()
        {
            const int currentPage = 1;

            var paging = new Paging<string>(new System.Collections.Generic.List<string>(), currentPage, _pageSize);

            Assert.AreEqual(currentPage, paging.CurrentPage);
            Assert.AreEqual(0, paging.Count);
            Assert.AreEqual(0, paging.PageCount);
            Assert.AreEqual(_pageSize, paging.PageSize);
            Assert.AreEqual(0, paging.Skip);
        }
开发者ID:adrianocaldeira,项目名称:thunder,代码行数:12,代码来源:PagingTest.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# PagingInfo类代码示例发布时间:2022-05-24
下一篇:
C# Pagination类代码示例发布时间: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