2 // SecurityCollection.cs: Handles WS-Security SecurityCollection
\r
5 // Sebastien Pouliot (spouliot@motus.com)
\r
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
\r
9 // Licensed under MIT X11 (see LICENSE) with this specific addition:
\r
11 //
\93This source code may incorporate intellectual property owned by Microsoft
\r
12 // Corporation. Our provision of this source code does not include any licenses
\r
13 // or any other rights to you under any Microsoft intellectual property. If you
\r
14 // would like a license from Microsoft (e.g. rebrand, redistribute), you need
\r
15 // to contact Microsoft directly.
\94 \r
19 using System.Collections;
\r
21 namespace Microsoft.Web.Services.Security {
\r
23 public class SecurityCollection : ICollection, IEnumerable {
\r
25 private ArrayList list;
\r
27 public SecurityCollection ()
\r
29 list = new ArrayList ();
\r
33 get { return list.Count; }
\r
36 public bool IsSynchronized {
\r
37 get { return list.IsSynchronized; }
\r
40 public Security this [Uri actor] {
\r
43 throw new ArgumentNullException ("actor");
\r
48 public Security this [string actor] {
\r
51 throw new ArgumentNullException ("actor");
\r
56 public object SyncRoot {
\r
57 get { return list.SyncRoot; }
\r
60 public void Add (Security security)
\r
62 // note: doc says it not ArgumentNullException
\r
63 if (security == null)
\r
64 throw new ArgumentException ("security");
\r
65 if (list.Contains (security))
\r
66 throw new ArgumentException ("duplicate");
\r
67 list.Add (security);
\r
70 public void Clear ()
\r
75 public bool Contains (string actor)
\r
78 throw new ArgumentNullException ("actor");
\r
82 public bool Contains (Uri actor)
\r
85 throw new ArgumentNullException ("actor");
\r
89 public void CopyTo (Array array, int index)
\r
92 throw new ArgumentNullException ("array");
\r
95 public IEnumerator GetEnumerator ()
\r
97 return list.GetEnumerator ();
\r
100 public void Remove (string actor)
\r
103 throw new ArgumentNullException ("actor");
\r
106 public void Remove (Uri actor)
\r
109 throw new ArgumentNullException ("actor");
\r