3 * Namespace : System.Web.UI.MobileControls
5 * Author : Gaurav Vaish
7 * Copyright : 2003 with Gaurav Vaish, and with
11 using System.Web.Mobile;
13 namespace System.Web.UI.MobileControls
15 public class ControlPager
17 private int pageCount = 0;
18 private int maxPage = -1;
20 private int remainingWt = 0;
24 // To ponder: will const be better?
25 public static readonly int DefaultWeight = 100;
26 public static readonly int UseDefaultWeight = -1;
28 public ControlPager(Form form, int pageWeight)
31 this.pageWt = pageWeight;
46 public int MaximumPage
70 public int RemainingWeight
82 public ItemPager GetItemPager(MobileControl control, int itemCount,
83 int itemsPerPage, int itemWeight)
85 return new ItemPager(this, control, itemCount,
86 itemsPerPage, itemWeight);
89 public int GetPage(int weight)
91 if(weight > remainingWt)
94 RemainingWeight = PageWeight;
96 if(remainingWt > weight)
98 remainingWt -= weight;