2 // EncryptionProperties.cs - EncryptionProperties implementation for XML Encryption
3 // http://www.w3.org/2001/04/xmlenc#sec-EncryptionProperties
6 // Tim Coleman (tim@timcoleman.com)
8 // Copyright (C) Tim Coleman, 2004
9 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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.
32 using System.Collections;
33 using System.Runtime.CompilerServices;
36 namespace System.Security.Cryptography.Xml {
38 public sealed class EncryptionPropertyCollection : IList, ICollection, IEnumerable {
48 public EncryptionPropertyCollection ()
50 list = new ArrayList ();
53 #endregion // Constructors
58 get { return list.Count; }
61 public bool IsFixedSize {
62 get { return list.IsFixedSize; }
65 public bool IsReadOnly {
66 get { return list.IsReadOnly; }
69 public bool IsSynchronized {
70 get { return list.IsSynchronized; }
73 object IList.this [int index] {
74 get { return this [index]; }
75 set { this [index] = (EncryptionProperty) value; }
78 [IndexerName ("ItemOf")]
79 public EncryptionProperty this [int index] {
80 get { return (EncryptionProperty) list [index]; }
81 set { list [index] = value; }
84 public object SyncRoot {
85 get { return list.SyncRoot; }
88 #endregion // Properties
92 public int Add (EncryptionProperty value)
94 return list.Add (value);
102 public bool Contains (EncryptionProperty value)
104 return list.Contains (value);
107 public void CopyTo (Array array, int index)
109 list.CopyTo (array, index);
112 public void CopyTo (EncryptionProperty[] array, int index)
114 list.CopyTo (array, index);
117 public IEnumerator GetEnumerator ()
119 return list.GetEnumerator ();
122 bool IList.Contains (object value)
124 return Contains ((EncryptionProperty) value);
127 int IList.Add (object value)
129 return Add ((EncryptionProperty) value);
132 int IList.IndexOf (object value)
134 return IndexOf ((EncryptionProperty) value);
137 void IList.Insert (int index, object value)
139 Insert (index, (EncryptionProperty) value);
142 void IList.Remove (object value)
144 Remove ((EncryptionProperty) value);
147 public int IndexOf (EncryptionProperty value)
149 return list.IndexOf (value);
152 public void Insert (int index, EncryptionProperty value)
154 list.Insert (index, value);
157 public EncryptionProperty Item (int index)
159 return (EncryptionProperty) list [index];
162 public void Remove (EncryptionProperty value)
167 public void RemoveAt (int index)
169 list.RemoveAt (index);
172 #endregion // Methods