System.Drawing: added email to icon and test file headers
[mono.git] / mcs / class / System / System.ComponentModel / ListSortDescriptionCollection.cs
1 // Permission is hereby granted, free of charge, to any person obtaining
2 // a copy of this software and associated documentation files (the
3 // "Software"), to deal in the Software without restriction, including
4 // without limitation the rights to use, copy, modify, merge, publish,
5 // distribute, sublicense, and/or sell copies of the Software, and to
6 // permit persons to whom the Software is furnished to do so, subject to
7 // the following conditions:
8 // 
9 // The above copyright notice and this permission notice shall be
10 // included in all copies or substantial portions of the Software.
11 // 
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
16 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
17 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 //
20 // Copyright (c) 2008 Novell, Inc. (http://www.novell.com)
21 //
22 // Author:
23 //      Pedro Martínez Juliá <pedromj@gmail.com>
24 //      Ivan N. Zlatev <contact@i-nz.net>
25 //
26
27
28 #if NET_2_0
29
30 using System.Collections;
31
32 namespace System.ComponentModel {
33
34         public class ListSortDescriptionCollection : IList, ICollection, IEnumerable {
35
36                 ArrayList list;
37
38                 public ListSortDescriptionCollection () {
39                         list = new ArrayList();
40                 }
41
42                 public ListSortDescriptionCollection (ListSortDescription[] sorts) {
43                         list = new ArrayList();
44                         foreach (ListSortDescription item in sorts)
45                                 list.Add (item);
46                 }
47
48                 public int Count {
49                         get { return list.Count; }
50                 }
51
52                 public ListSortDescription this [int index] {
53                         get { return list[index] as ListSortDescription; }
54                         set { throw new InvalidOperationException("ListSortDescriptorCollection is read only."); }
55                 }
56
57                 public bool Contains (object value) {
58                         return list.Contains(value);
59                 }
60
61                 public void CopyTo (Array array, int index) {
62                         list.CopyTo(array, index);
63                 }
64
65                 public int IndexOf (object value) {
66                         return list.IndexOf(value);
67                 }
68
69                 object IList.this [int index] {
70                         get { return this[index]; }
71                         set { throw new InvalidOperationException("ListSortDescriptorCollection is read only."); }
72                 }
73
74                 bool IList.IsFixedSize {
75                         get { return list.IsFixedSize; }
76                 }
77
78                 bool ICollection.IsSynchronized {
79                         get { return list.IsSynchronized; }
80                 }
81
82                 object ICollection.SyncRoot {
83                         get { return list.SyncRoot; }
84                 }
85
86                 bool IList.IsReadOnly {
87                         get { return list.IsReadOnly; }
88                 }
89
90                 IEnumerator IEnumerable.GetEnumerator () {
91                         return list.GetEnumerator();
92                 }
93
94                 int IList.Add (object value) {
95                         return list.Add(value);
96                 }
97
98                 void IList.Clear () {
99                         list.Clear();
100                 }
101
102                 void IList.Insert (int index, object value) {
103                         list.Insert(index, value);
104                 }
105
106                 void IList.Remove (object value) {
107                         list.Remove(value);
108                 }
109
110                 void IList.RemoveAt (int index) {
111                         list.RemoveAt(index);
112                 }
113
114         }
115
116 }
117
118 #endif