2003-09-04 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / System.Web.Mobile / System.Web.UI.MobileControls / ArrayListCollectionBase.cs
1 /**
2  * Project   : Mono
3  * Namespace : System.Web.UI.MobileControls
4  * Class     : ArrayListCollectionBase
5  * Author    : Gaurav Vaish
6  *
7  * Copyright : 2003 with Gaurav Vaish, and with
8  *             Ximian Inc
9  */
10
11 using System.Collections;
12
13 namespace System.Web.UI.MobileControls
14 {
15         public class ArrayListCollectionBase : ICollection, IEnumerable
16         {
17                 private ArrayList items;
18                 internal ArrayListCollectionBase()
19                 {
20                 }
21
22                 internal ArrayListCollectionBase(ArrayList items)
23                 {
24                         this.items = items;
25                 }
26
27                 public int Count
28                 {
29                         get
30                         {
31                                 return (items == null ? 0 : items.Count);
32                         }
33                 }
34
35                 public bool IsReadOnly
36                 {
37                         get
38                         {
39                                 return (items == null ? false : items.IsReadOnly);
40                         }
41                 }
42
43                 public bool IsSynchronized
44                 {
45                         get
46                         {
47                                 return false;
48                         }
49                 }
50
51                 public object SyncRoot
52                 {
53                         get
54                         {
55                                 return this;
56                         }
57                 }
58
59                 protected ArrayList Items
60                 {
61                         get
62                         {
63                                 if(items == null)
64                                         items = new ArrayList();
65                                 return items;
66                         }
67                         set
68                         {
69                                 items = value;
70                         }
71                 }
72
73                 public void CopyTo(Array array, int index)
74                 {
75                         Items.CopyTo(array, index);
76                 }
77
78                 public IEnumerator GetEnumerator()
79                 {
80                         return Items.GetEnumerator();
81                 }
82         }
83 }