2003-09-04 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / System.Web.Mobile / System.Web.UI.MobileControls / DeviceSpecificChoiceCollection.cs
1 /**
2  * Project   : Mono
3  * Namespace : System.Web.UI.MobileControls
4  * Class     : DeviceSpecificChoiceCollection
5  * Author    : Gaurav Vaish
6  *
7  * Copyright : 2003 with Gaurav Vaish, and with
8  *             Ximian Inc
9  */
10
11 using System.Collections;
12 using System.Reflection;
13 using System.Web.UI;
14 using System.Web.Mobile;
15
16 namespace System.Web.UI.MobileControls
17 {
18         public class DeviceSpecificChoiceCollection
19                      : ArrayListCollectionBase
20         {
21                 private DeviceSpecific owner;
22
23                 internal DeviceSpecificChoiceCollection(DeviceSpecific owner)
24                 {
25                         this.owner = owner;
26                 }
27
28                 public DeviceSpecificChoice this[int index]
29                 {
30                         get
31                         {
32                                 return (DeviceSpecificChoice)base.Items[index];
33                         }
34                 }
35
36                 public ArrayList All
37                 {
38                         get
39                         {
40                                 return base.Items;
41                         }
42                 }
43
44                 public void Add(DeviceSpecificChoice choice)
45                 {
46                         AddAt(-1, choice);
47                 }
48
49                 public void AddAt(int index, DeviceSpecificChoice choice)
50                 {
51                         choice.Owner = owner;
52                         if(index == -1)
53                                 Items.Add(choice);
54                         else
55                                 Items.Insert(index, choice);
56                 }
57
58                 public void Clear()
59                 {
60                         Items.Clear();
61                 }
62         }
63 }