Ejemplo n.º 1
0
 private string WrapPageButton(PageButton btn)
 {
     string result = string.Empty;
     if (btn.Disabled)
         return String.Format("<li><a disabled=\"disabled\">{0}</a></li>", btn.Text);
     result = String.Format("<li><a href='{0}'>{1}</a></li>", _GetUrlCallback(PagerSetting.HtmlRequestContext, PagerSetting.PageParameterName, btn.PageIndex), btn.Text);
     return result;
 }
Ejemplo n.º 2
0
 private void AddNumberButton(IList<PageButton> pageBtnList)
 {
     for (var pageIndex = _StartPageIndex; pageIndex <= _EndPageIndex; pageIndex++)
     {
         var text = pageIndex.ToString();
         if (pageIndex == PagerSetting.CurrentPageIndex && !string.IsNullOrEmpty(PagerSetting.CurrentPageNumberFormatString))
             text = String.Format(PagerSetting.CurrentPageNumberFormatString, text);
         else if (!string.IsNullOrEmpty(PagerSetting.PageNumberFormatString))
             text = String.Format(PagerSetting.PageNumberFormatString, text);
         var item = new PageButton(text, pageIndex, false, PageButtonType.NumericPageButton);
         pageBtnList.Add(item);
     }
 }
Ejemplo n.º 3
0
 private void AddPrevButton(IList<PageButton> pageBtnList)
 {
     var previtem = new PageButton(PagerSetting.PrevPageText, PagerSetting.CurrentPageIndex - 1, PagerSetting.CurrentPageIndex == 1, PageButtonType.PrevPageButton);
     pageBtnList.Add(previtem);
 }
Ejemplo n.º 4
0
 private void AddNextButton(IList<PageButton> pageBtnList)
 {
     var nextitem = new PageButton(PagerSetting.NextPageText, PagerSetting.CurrentPageIndex + 1, PagerSetting.CurrentPageIndex >= PagerSetting.PageCount, PageButtonType.NextPageButton);
     pageBtnList.Add(nextitem);
 }
Ejemplo n.º 5
0
 private void AddMoreButtonBefore(IList<PageButton> pageBtnList)
 {
     if (_StartPageIndex > 1 && PagerSetting.ShowMorePagerItems)
     {
         var index = _StartPageIndex - 1;
         if (index < 1) index = 1;
         PageButton item = new PageButton(PagerSetting.MorePageText, index, false, PageButtonType.MorePageButton);
         pageBtnList.Add(item);
     }
 }
Ejemplo n.º 6
0
 private void AddMoreButtonAfter(IList<PageButton> pageBtnList)
 {
     if (_EndPageIndex < PagerSetting.PageCount)
     {
         var index = _StartPageIndex + PagerSetting.NumericPagerCount;
         if (index > PagerSetting.PageCount) index = PagerSetting.PageCount;
         var item = new PageButton(PagerSetting.MorePageText, index, false, PageButtonType.MorePageButton);
         pageBtnList.Add(item);
     }
 }
Ejemplo n.º 7
0
 private void AddLastButton(IList<PageButton> pageBtnList)
 {
     var lastitem = new PageButton(PagerSetting.LastPageText, PagerSetting.PageCount, PagerSetting.CurrentPageIndex >= PagerSetting.PageCount, PageButtonType.LastPageButton);
     pageBtnList.Add(lastitem);
 }
Ejemplo n.º 8
0
 private void AddFristButton(IList<PageButton> pageBtnList)
 {
     PageButton fristitem = new PageButton(PagerSetting.FirstPageText, 1, PagerSetting.CurrentPageIndex == 1, PageButtonType.FirstPageButton);
     pageBtnList.Add(fristitem);
 }