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;
 }
Beispiel #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);
     }
 }
Beispiel #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);
 }
Beispiel #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);
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #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);
 }
Beispiel #8
0
 private void AddFristButton(IList<PageButton> pageBtnList)
 {
     PageButton fristitem = new PageButton(PagerSetting.FirstPageText, 1, PagerSetting.CurrentPageIndex == 1, PageButtonType.FirstPageButton);
     pageBtnList.Add(fristitem);
 }