Merge pull request #1458 from BrzVlad/feature-fat-cas
[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
32 using System.Collections;
33 using System.Runtime.CompilerServices;
34 using System.Xml;
35
36 namespace System.Security.Cryptography.Xml {
37
38         public sealed class EncryptionPropertyCollection : IList, ICollection, IEnumerable {
39
40                 #region Fields
41                 
42                 ArrayList list;
43
44                 #endregion // Fields
45         
46                 #region Constructors
47
48                 public EncryptionPropertyCollection ()
49                 {
50                         list = new ArrayList ();
51                 }
52         
53                 #endregion // Constructors
54         
55                 #region Properties
56
57                 public int Count {
58                         get { return list.Count; }
59                 }
60
61                 public bool IsFixedSize {
62                         get { return list.IsFixedSize; }
63                 }
64
65                 public bool IsReadOnly {
66                         get { return list.IsReadOnly; }
67                 }
68
69                 public bool IsSynchronized {
70                         get { return list.IsSynchronized; }
71                 }
72
73                 object IList.this [int index] {
74                         get { return this [index]; }
75                         set { this [index] = (EncryptionProperty) value; }
76                 }
77
78                 [IndexerName ("ItemOf")]
79                 public EncryptionProperty this [int index] {
80                         get { return (EncryptionProperty) list [index]; }
81                         set { list [index] = value; }
82                 }
83
84                 public object SyncRoot {
85                         get { return list.SyncRoot; }
86                 }
87
88                 #endregion // Properties
89
90                 #region Methods
91
92                 public int Add (EncryptionProperty value)
93                 {
94                         return list.Add (value);
95                 }
96
97                 public void Clear ()
98                 {
99                         list.Clear ();
100                 }
101
102                 public bool Contains (EncryptionProperty value)
103                 {
104                         return list.Contains (value);
105                 }
106
107                 public void CopyTo (Array array, int index)
108                 {
109                         list.CopyTo (array, index);
110                 }
111
112                 public void CopyTo (EncryptionProperty[] array, int index)
113                 {
114                         list.CopyTo (array, index);
115                 }
116
117                 public IEnumerator GetEnumerator ()
118                 {
119                         return list.GetEnumerator ();
120                 }
121
122                 bool IList.Contains (object value)
123                 {
124                         return Contains ((EncryptionProperty) value);
125                 }
126
127                 int IList.Add (object value)
128                 {
129                         return Add ((EncryptionProperty) value);
130                 }
131
132                 int IList.IndexOf (object value)
133                 {
134                         return IndexOf ((EncryptionProperty) value);
135                 }
136
137                 void IList.Insert (int index, object value)
138                 {
139                         Insert (index, (EncryptionProperty) value);
140                 }
141
142                 void IList.Remove (object value)
143                 {
144                         Remove ((EncryptionProperty) value);
145                 }
146
147                 public int IndexOf (EncryptionProperty value)
148                 {
149                         return list.IndexOf (value);
150                 }
151
152                 public void Insert (int index, EncryptionProperty value)
153                 {
154                         list.Insert (index, value);
155                 }
156
157                 public EncryptionProperty Item (int index)
158                 {
159                         return (EncryptionProperty) list [index];
160                 }
161
162                 public void Remove (EncryptionProperty value)
163                 {
164                         list.Remove (value);
165                 }
166
167                 public void RemoveAt (int index)
168                 {
169                         list.RemoveAt (index);
170                 }
171
172                 #endregion // Methods
173         }
174 }
175