afd7b9b4dc424dca85f8c6dafdb793c626e1c1d7
[mono.git] / mcs / class / System / System.ComponentModel / EventDescriptorCollection.cs
1 //
2 // System.ComponentModel.EventDescriptorCollection.cs
3 //
4 // Author: Rodrigo Moya (rodrigo@ximian.com)
5 //
6 // (C) Ximian, Inc.
7 //
8
9 using System.Collections;
10
11 namespace System.ComponentModel
12 {
13         public class EventDescriptorCollection : IList, ICollection, IEnumerable
14         {
15                 private ArrayList eventList;
16                 
17                 public static readonly EventDescriptorCollection Empty;
18                 
19                 public EventDescriptorCollection (EventDescriptor[] events) {
20                         for (int i = 0; i < events.Length; i++)
21                                 this.Add (events[i]);
22                 }
23
24                 public int Add (EventDescriptor value) {
25                         return eventList.Add (value);
26                 }
27
28                 public void Clear () {
29                         eventList.Clear ();
30                 }
31
32                 public bool Contains (EventDescriptor value) {
33                         return eventList.Contains (value);
34                 }
35
36                 [MonoTODO]
37                 public virtual EventDescriptor Find (string name, bool ignoreCase) {
38                         throw new NotImplementedException ();
39                 }
40
41                 public IEnumerator GetEnumerator () {
42                         return eventList.GetEnumerator ();
43                 }
44
45                 public int IndexOf (EventDescriptor value) {
46                         return eventList.IndexOf (value);
47                 }
48
49                 public void Insert (int index, EventDescriptor value) {
50                         eventList.Insert (index, value);
51                 }
52
53                 public void Remove (EventDescriptor value) {
54                         eventList.Remove (value);
55                 }
56
57                 public void RemoveAt (int index) {
58                         eventList.RemoveAt (index);
59                 }
60
61
62                 [MonoTODO]
63                 public virtual EventDescriptorCollection Sort () {
64                         throw new NotImplementedException ();
65                 }
66
67                 [MonoTODO]
68                 public virtual EventDescriptorCollection Sort (IComparer comparer) {
69                         throw new NotImplementedException ();
70                 }
71
72                 [MonoTODO]
73                 public virtual EventDescriptorCollection Sort (string[] order) {
74                         throw new NotImplementedException ();
75                 }
76
77                 [MonoTODO]
78                 public virtual EventDescriptorCollection Sort (string[] order,
79                                                                IComparer comparer) {
80                         throw new NotImplementedException ();
81                 }
82
83                 [MonoTODO]
84                 public virtual EventDescriptorCollection InternalSort (IComparer comparer) {
85                         throw new NotImplementedException ();
86                 }
87
88                 [MonoTODO]
89                 public virtual EventDescriptorCollection InternalSort (string[] order) {
90                         throw new NotImplementedException ();
91                 }
92                 
93                 public int Count {
94                         get {
95                                 return eventList.Count;
96                         }
97                 }
98
99                  public virtual EventDescriptor this[string name] {
100                          [MonoTODO]
101                          get {
102                                  throw new NotImplementedException ();
103                          }
104                  }
105
106                 public virtual EventDescriptor this[int index] {
107                         get {
108                                 return (EventDescriptor) eventList[index];
109                         }
110                 }
111
112                 // IList methods
113
114                 int IList.Add (object value) {
115                         return Add ((EventDescriptor) value);
116                 }
117
118                 bool IList.Contains (object value) {
119                         return Contains ((EventDescriptor) value);
120                 }
121
122                 int IList.IndexOf (object value) {
123                         return IndexOf ((EventDescriptor) value);
124                 }
125
126                 void IList.Insert (int index, object value) {
127                         Insert (index, (EventDescriptor) value);
128                 }
129
130                 void IList.Remove (object value) {
131                         Remove ((EventDescriptor) value);
132                 }
133
134                 bool IList.IsFixedSize {
135                         get { return false; }
136                 }
137
138 //              [MonoTODO]
139                 bool IList.IsReadOnly {
140                         get { return false; }
141                 }
142
143                 object IList.this [int index] {
144                         get { return this [index]; }
145                         [MonoTODO]
146                         set { throw new NotImplementedException (); }
147                 }
148
149                 // ICollection methods
150
151                 [MonoTODO]
152                 void ICollection.CopyTo (Array array, int index) {
153                         throw new NotImplementedException ();
154                 }
155
156                 bool ICollection.IsSynchronized {
157                         get { return false; }
158                 }
159
160                 object ICollection.SyncRoot {
161                         get { return null; }
162                 }
163         }
164 }