diff options
author | Sebastien Pouliot <sebastien@ximian.com> | 2003-01-31 06:14:33 +0300 |
---|---|---|
committer | Sebastien Pouliot <sebastien@ximian.com> | 2003-01-31 06:14:33 +0300 |
commit | 1c316f3ee4fc16cf5ce2987099503e885b1e511a (patch) | |
tree | e8e47bf672873ad5583e503d75e56d440489b4da /mcs/class/System/System.Security.Cryptography.X509Certificates | |
parent | ba97f327973b65070c690d8408e76e1cf27310ba (diff) |
2003-01-30 Sebastien Pouliot <spouliot@videotron.ca>
* X509CertificateCollection.cs: Replaced the use of the private
ArrayList by the protected InnerList (from CollectionBase) so
Count property now works.
svn path=/trunk/mcs/; revision=11072
Diffstat (limited to 'mcs/class/System/System.Security.Cryptography.X509Certificates')
-rw-r--r-- | mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog | 22 | ||||
-rw-r--r-- | mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs | 306 |
2 files changed, 166 insertions, 162 deletions
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog index 0642777be8a..fced32483a9 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog @@ -1,8 +1,14 @@ -2002-10-21 Miguel de Icaza <miguel@ximian.com>
-
- * X509CertificateCollection.cs (Add): New method.
-
-2002-05-12 Lawrence Pit <loz@cable.a2000.nl>
-
- * X509CertificateCollection.cs: implemented
-
+2003-01-30 Sebastien Pouliot <spouliot@videotron.ca> + + * X509CertificateCollection.cs: Replaced the use of the private + ArrayList by the protected InnerList (from CollectionBase) so + Count property now works. + +2002-10-21 Miguel de Icaza <miguel@ximian.com> + + * X509CertificateCollection.cs (Add): New method. + +2002-05-12 Lawrence Pit <loz@cable.a2000.nl> + + * X509CertificateCollection.cs: implemented + diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs index c414ec8ab7a..6591b4919bd 100644 --- a/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs +++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs @@ -1,154 +1,152 @@ -//
-// System.Security.Cryptography.X509Certificates.X509CertificateCollection
-//
-// Author:
-// Lawrence Pit (loz@cable.a2000.nl)
-//
-
-using System;
-using System.Collections;
-using System.Security.Cryptography;
-
-namespace System.Security.Cryptography.X509Certificates {
-
- [Serializable]
- public class X509CertificateCollection : CollectionBase, IEnumerable {
-
- private ArrayList list = new ArrayList ();
-
- // Constructors
-
- public X509CertificateCollection () { }
-
- public X509CertificateCollection (X509Certificate [] value)
- {
- AddRange (value);
- }
-
- public X509CertificateCollection (X509CertificateCollection value)
- {
- AddRange (value);
- }
-
- // Properties
-
- public X509Certificate this [int index] {
- get { return (X509Certificate) list [index]; }
- set { list [index] = value; }
- }
-
- // Methods
-
- public int Add (X509Certificate value)
- {
- if (value == null)
- throw new ArgumentNullException ("value");
-
- return list.Add (value);
- }
-
- public void AddRange (X509Certificate [] value)
- {
- if (value == null)
- throw new ArgumentNullException ("value");
- for (int i = 0; i < value.Length; i++)
- list.Add (value);
- }
-
- public void AddRange (X509CertificateCollection value)
- {
- if (value == null)
- throw new ArgumentNullException ("value");
- int len = value.list.Count;
- for (int i = 0; i < len; i++)
- this.list.Add (value);
- }
-
- public bool Contains (X509Certificate value)
- {
- return list.Contains (value);
- }
-
-
- public void CopyTo (X509Certificate [] array, int index)
- {
- list.CopyTo (array, index);
- }
-
- public new X509CertificateEnumerator GetEnumerator()
- {
- return new X509CertificateEnumerator (this);
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return list.GetEnumerator ();
- }
-
- public override int GetHashCode()
- {
- return list.GetHashCode ();
- }
-
- public int IndexOf (X509Certificate value)
- {
- return list.IndexOf (value);
- }
-
- public void Insert (int index, X509Certificate value)
- {
- list.Insert (index, value);
- }
-
- public void Remove (X509Certificate value)
- {
- list.Remove (value);
- }
-
- // Inner Class
-
- public class X509CertificateEnumerator : IEnumerator {
- private IEnumerator enumerator;
-
- // Constructors
-
- public X509CertificateEnumerator (X509CertificateCollection mappings)
- {
- enumerator = ((IEnumerable) mappings).GetEnumerator ();
- }
-
- // Properties
-
- public X509Certificate Current {
- get { return (X509Certificate) enumerator.Current; }
- }
-
- object IEnumerator.Current {
- get { return (X509Certificate) enumerator.Current; }
- }
-
- // Methods
-
- bool IEnumerator.MoveNext ()
- {
- return enumerator.MoveNext ();
- }
-
- void IEnumerator.Reset ()
- {
- enumerator.Reset ();
- }
-
- public bool MoveNext ()
- {
- return enumerator.MoveNext ();
- }
-
- public void Reset ()
- {
- enumerator.Reset ();
- }
- }
- }
-}
-
+// +// System.Security.Cryptography.X509Certificates.X509CertificateCollection +// +// Author: +// Lawrence Pit (loz@cable.a2000.nl) +// + +using System; +using System.Collections; +using System.Security.Cryptography; + +namespace System.Security.Cryptography.X509Certificates { + +[Serializable] +public class X509CertificateCollection : CollectionBase, IEnumerable { + + public X509CertificateCollection () {} + + public X509CertificateCollection (X509Certificate [] value) + { + AddRange (value); + } + + public X509CertificateCollection (X509CertificateCollection value) + { + AddRange (value); + } + + // Properties + + public X509Certificate this [int index] { + get { return (X509Certificate) InnerList [index]; } + set { InnerList [index] = value; } + } + + // Methods + + public int Add (X509Certificate value) + { + if (value == null) + throw new ArgumentNullException ("value"); + + return InnerList.Add (value); + } + + public void AddRange (X509Certificate [] value) + { + if (value == null) + throw new ArgumentNullException ("value"); + for (int i = 0; i < value.Length; i++) + InnerList.Add (value); + } + + public void AddRange (X509CertificateCollection value) + { + if (value == null) + throw new ArgumentNullException ("value"); + int len = value.InnerList.Count; + for (int i = 0; i < len; i++) + InnerList.Add (value); + } + + public bool Contains (X509Certificate value) + { + return InnerList.Contains (value); + } + + + public void CopyTo (X509Certificate[] array, int index) + { + InnerList.CopyTo (array, index); + } + + public new X509CertificateEnumerator GetEnumerator () + { + return new X509CertificateEnumerator (this); + } + + IEnumerator IEnumerable.GetEnumerator () + { + return InnerList.GetEnumerator (); + } + + public override int GetHashCode () + { + return InnerList.GetHashCode (); + } + + public int IndexOf (X509Certificate value) + { + return InnerList.IndexOf (value); + } + + public void Insert (int index, X509Certificate value) + { + InnerList.Insert (index, value); + } + + public void Remove (X509Certificate value) + { + InnerList.Remove (value); + } + + // Inner Class + + public class X509CertificateEnumerator : IEnumerator { + + private IEnumerator enumerator; + + // Constructors + + public X509CertificateEnumerator (X509CertificateCollection mappings) + { + enumerator = ((IEnumerable) mappings).GetEnumerator (); + } + + // Properties + + public X509Certificate Current { + get { return (X509Certificate) enumerator.Current; } + } + + object IEnumerator.Current { + get { return (X509Certificate) enumerator.Current; } + } + + // Methods + + bool IEnumerator.MoveNext () + { + return enumerator.MoveNext (); + } + + void IEnumerator.Reset () + { + enumerator.Reset (); + } + + public bool MoveNext () + { + return enumerator.MoveNext (); + } + + public void Reset () + { + enumerator.Reset (); + } + } +} + +} + |