本文整理汇总了C#中Paging类的典型用法代码示例。如果您正苦于以下问题:C# Paging类的具体用法?C# Paging怎么用?C# Paging使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Paging类属于命名空间,在下文中一共展示了Paging类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例10: DataSelectParameter
public DataSelectParameter(string fullName, ICondition condition, string scope, Paging paging, Sorting[] sortings) : base(fullName)
{
_condition = condition;
_scope = scope;
_paging = paging;
_sortings = sortings;
}
示例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);
}
示例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);
}
示例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());
}
示例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;
}
示例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();
}