Ejemplo n.º 1
0
        private static int GetEndingPage(Pager pagerData, PagerSettings settings)
        {
            if (pagerData.TotalPages <= settings.NumberPagesToDisplay)
            {
                return(pagerData.TotalPages);
            }
            int range       = PagerCalculator.GetRange(pagerData.CurrentPage, settings.NumberPagesToDisplay);
            int totalRanges = PagerCalculator.GetTotalRanges(pagerData.TotalPages, settings.NumberPagesToDisplay);

            if (range == totalRanges)
            {
                return(pagerData.TotalPages);
            }
            return(range * settings.NumberPagesToDisplay);
        }
Ejemplo n.º 2
0
        private static int GetStartingPage(Pager pagerData, PagerSettings settings)
        {
            if (pagerData.CurrentPage <= settings.NumberPagesToDisplay)
            {
                return(1);
            }
            int num         = PagerCalculator.GetRange(pagerData.CurrentPage, settings.NumberPagesToDisplay);
            int totalRanges = PagerCalculator.GetTotalRanges(pagerData.TotalPages, settings.NumberPagesToDisplay);

            if (num == totalRanges)
            {
                return(pagerData.TotalPages - settings.NumberPagesToDisplay + 1);
            }
            num--;
            return(num * settings.NumberPagesToDisplay + 1);
        }
Ejemplo n.º 3
0
 private static int GetTotalRanges(int totalPages, int numberPagesToDisplay)
 {
     return(PagerCalculator.GetRange(totalPages, numberPagesToDisplay));
 }