Click here to Skip to main content
15,888,113 members

Comments by James Hurburgh (Top 3 by date)

James Hurburgh 6-Feb-12 23:32pm View    
Deleted
Reason for my vote of 5
IComparable is the way to go.
James Hurburgh 12-Jan-12 0:27am View    
Deleted
Use the System.Linq library.
Then you can turn this:
public Collection<e> GetPage(int pageIndex, int pageSize)
{
Collection<e> page = new Collection<e>();

for (int i = 0; i < Count; i++)
{
if (new PagingLocation(pageIndex, pageSize).IsInPage(i))
page.Add(this[i]);
}

return page;
}
Into this:
public Collection<e> GetPage(int pageIndex, int pageSize)
{
return new Collection<e>(this.Skip(pageIndex * pageSize).Take(pageSize));
}
James Hurburgh 10-Jan-12 1:50am View    
Deleted
Reason for my vote of 2
There are much simpler and more obvious ways of doing paging. Your description doesn't clearly or specifically state what problem the helper class is intended to solve.