* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / class / System.Security / System.Security.Cryptography.Xml / EncryptionProperties.cs
1 //
2 // EncryptionProperties.cs - EncryptionProperties implementation for XML Encryption
3 // http://www.w3.org/2001/04/xmlenc#sec-EncryptionProperties
4 //
5 // Author:
6 //      Tim Coleman (tim@timcoleman.com)
7 //
8 // Copyright (C) Tim Coleman, 2004
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 #if NET_2_0
32
33 using System.Collections;
34 using System.Runtime.CompilerServices;
35 using System.Xml;
36
37 namespace System.Security.Cryptography.Xml {
38
39         public sealed class EncryptionPropertyCollection : IList, ICollection, IEnumerable {
40
41                 #region Fields
42                 
43                 ArrayList list;
44
45                 #endregion // Fields
46         
47                 #region Constructors
48
49                 public EncryptionPropertyCollection ()
50                 {
51                         list = new ArrayList ();
52                 }
53         
54                 #endregion // Constructors
55         
56                 #region Properties
57
58                 public int Count {
59                         get { return list.Count; }
60                 }
61
62                 public bool IsFixedSize {
63                         get { return list.IsFixedSize; }
64                 }
65
66                 public bool IsReadOnly {
67                         get { return list.IsReadOnly; }
68                 }
69
70                 public bool IsSynchronized {
71                         get { return list.IsSynchronized; }
72                 }
73
74                 object IList.this [int index] {
75                         get { return this [index]; }
76                         set { this [index] = (EncryptionProperty) value; }
77                 }
78
79                 [IndexerName ("ItemOf")]
80                 public EncryptionProperty this [int index] {
81                         get { return (EncryptionProperty) list [index]; }
82                         set { list [index] = value; }
83                 }
84
85                 public object SyncRoot {
86                         get { return list.SyncRoot; }
87                 }
88
89                 #endregion // Properties
90
91                 #region Methods
92
93                 public int Add (EncryptionProperty value)
94                 {
95                         return list.Add (value);
96                 }
97
98                 public void Clear ()
99                 {
100                         list.Clear ();
101                 }
102
103                 public bool Contains (EncryptionProperty value)
104                 {
105                         return list.Contains (value);
106                 }
107
108                 public void CopyTo (Array array, int index)
109                 {
110                         list.CopyTo (array, index);
111                 }
112
113                 public void CopyTo (EncryptionProperty[] array, int index)
114                 {
115                         list.CopyTo (array, index);
116                 }
117
118                 public IEnumerator GetEnumerator ()
119                 {
120                         return list.GetEnumerator ();
121                 }
122
123                 bool IList.Contains (object value)
124                 {
125                         return Contains ((EncryptionProperty) value);
126                 }
127
128                 int IList.Add (object value)
129                 {
130                         return Add ((EncryptionProperty) value);
131                 }
132
133                 int IList.IndexOf (object value)
134                 {
135                         return IndexOf ((EncryptionProperty) value);
136                 }
137
138                 void IList.Insert (int index, object value)
139                 {
140                         Insert (index, (EncryptionProperty) value);
141                 }
142
143                 void IList.Remove (object value)
144                 {
145                         Remove ((EncryptionProperty) value);
146                 }
147
148                 public int IndexOf (EncryptionProperty value)
149                 {
150                         return list.IndexOf (value);
151                 }
152
153                 public void Insert (int index, EncryptionProperty value)
154                 {
155                         list.Insert (index, value);
156                 }
157
158                 public EncryptionProperty Item (int index)
159                 {
160                         return (EncryptionProperty) list [index];
161                 }
162
163                 public void Remove (EncryptionProperty value)
164                 {
165                         list.Remove (value);
166                 }
167
168                 public void RemoveAt (int index)
169                 {
170                         list.RemoveAt (index);
171                 }
172
173                 #endregion // Methods
174         }
175 }
176
177 #endif