Exemple #1
0
 public Paginator(IEnumerable <T> elements, int pageSize, string defaultValue = null)
 {
     _defaultValue = defaultValue;
     Elements      = elements.ToList();
     PageSize      = pageSize;
     PageCount     = Paginate.GetPageCount(Elements.Count, PageSize);
 }
Exemple #2
0
 public Page <T> PageAt(int index)
 {
     return(new Page <T>(Paginate.GetCollectionOffset(Elements.Count, PageSize, index),
                         Paginate.GroupAt(Elements, index, PageSize), _defaultValue));
 }