2 * Namespace: System.Web.UI.WebControls
\r
3 * Class: SelectedDatesCollection
\r
5 * Author: Gaurav Vaish
\r
6 * Maintainer: gvaish@iitk.ac.in
\r
7 * Contact: <my_scripts2001@yahoo.com>, <gvaish@iitk.ac.in>
\r
8 * Implementation: yes
\r
11 * (C) Gaurav Vaish (2002)
\r
15 using System.Collections;
\r
17 using System.Web.UI;
\r
19 namespace System.Web.UI.WebControls
\r
21 public sealed class SelectedDatesCollection : ICollection, IEnumerable
\r
25 public SelectedDatesCollection(ArrayList dateList)
\r
27 this.dateList = dateList;
\r
34 return dateList.Count;
\r
38 public bool IsReadOnly
\r
46 public bool IsSynchronized
\r
54 public DateTime this[int index]
\r
58 return (DateTime)(dateList[index]);
\r
62 public object SyncRoot
\r
70 public void Add(DateTime date)
\r
80 public bool Contains(DateTime date)
\r
82 return dateList.Contains(date);
\r
85 public void CopyTo(Array array, int index)
\r
87 foreach(DateTime current in this)
\r
89 array.SetValue(current, index++);
\r
93 public IEnumerator GetEnumerator()
\r
95 return dateList.GetEnumerator();
\r
98 public void Remove(DateTime date)
\r
100 dateList.Remove(date);
\r
103 public void SelectRange(DateTime fromDate, DateTime toDate)
\r
106 //FIXME: Probable bug in MS implementation. It SHOULD NOT
\r
107 // clear the list if fromDate > toDate
\r
108 if(fromDate > toDate)
\r
112 DateTime local = fromDate;
\r
115 dateList.Add(local);
\r
116 local = local.AddDays(1);
\r
117 } while(local <= toDate);
\r
120 internal ArrayList GetDateList ()
\r