2 // ReferenceList.cs - ReferenceList implementation for XML Encryption
3 // http://www.w3.org/2001/04/xmlenc#sec-ReferenceList
6 // Tim Coleman (tim@timcoleman.com)
8 // Copyright (C) Tim Coleman, 2004
12 using System.Collections;
15 namespace System.Security.Cryptography.Xml {
16 public sealed class ReferenceList : IList, ICollection, IEnumerable {
26 public ReferenceList ()
28 list = new ArrayList ();
31 #endregion // Constructors
36 get { return list.Count; }
39 object IList.this [int index] {
40 get { return this [index]; }
41 set { this [index] = (EncryptedReference) value; }
44 public bool IsFixedSize {
45 get { return list.IsFixedSize; }
48 public bool IsReadOnly {
49 get { return list.IsReadOnly; }
52 public bool IsSynchronized {
53 get { return list.IsSynchronized; }
56 public EncryptedReference this [int oid] {
57 get { return (EncryptedReference) list [oid]; }
58 set { this [oid] = value; }
61 public object SyncRoot {
62 get { return list.SyncRoot; }
65 #endregion // Properties
69 public int Add (object value)
71 if (!(value is EncryptedReference))
72 throw new ArgumentException ("value");
73 return list.Add (value);
81 public bool Contains (object value)
83 return list.Contains (value);
86 public void CopyTo (Array array, int index)
88 list.CopyTo (array, index);
91 public IEnumerator GetEnumerator ()
93 return list.GetEnumerator ();
96 public int IndexOf (object value)
98 return list.IndexOf (value);
101 public void Insert (int index, object value)
103 if (!(value is EncryptedReference))
104 throw new ArgumentException ("value");
105 list.Insert (index, value);
108 public void Remove (object value)
113 public void RemoveAt (int index)
115 list.RemoveAt (index);
118 #endregion // Methods