Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLawrence Pit <lawrence@mono-cvs.ximian.com>2002-05-12 12:30:38 +0400
committerLawrence Pit <lawrence@mono-cvs.ximian.com>2002-05-12 12:30:38 +0400
commit889afab1de429d77e51af8b015d7cc550630bff1 (patch)
treef760485b745d97c2de4670bb57153372defbd1ff /mcs/class/System/System.Security.Cryptography.X509Certificates
parent1073470bc96abef6765cda93723652a52a4bf6a9 (diff)
* X509CertificateCollection.cs: implemented
svn path=/trunk/mcs/; revision=4550
Diffstat (limited to 'mcs/class/System/System.Security.Cryptography.X509Certificates')
-rw-r--r--mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog4
-rw-r--r--mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs146
2 files changed, 150 insertions, 0 deletions
diff --git a/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
new file mode 100644
index 00000000000..c8684168dca
--- /dev/null
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/ChangeLog
@@ -0,0 +1,4 @@
+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
new file mode 100644
index 00000000000..82546c7a295
--- /dev/null
+++ b/mcs/class/System/System.Security.Cryptography.X509Certificates/X509CertificateCollection.cs
@@ -0,0 +1,146 @@
+//
+// 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 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 ();
+ }
+ }
+ }
+}
+