vgquotes/Src/VideoGameQuotes.Web/Models/PagedQuoteCollectionModel.cs

14 lines
585 B
C#
Raw Normal View History

2011-02-15 00:18:29 +00:00
using System;
namespace VideoGameQuotes.Web.Models {
public class PagedQuoteCollectionModel : QuoteCollectionModel {
public int Start { get; set; }
public int End { get; set; }
public int PageSize { get { return End - Start + 1; } }
public int NextStart { get { return End + 1; } }
public int NextEnd { get { return End + PageSize; } }
public int PreviousStart { get { return Math.Max(0, Start - PageSize); } }
public int PreviousEnd { get { return Math.Max(PageSize - 1, End - PageSize); } }
public bool HasPrevious { get { return Start > 0; } }
}
}