New test.
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Security / SecurityCollection.cs
1 //\r
2 // SecurityCollection.cs: Handles WS-Security SecurityCollection\r
3 //\r
4 // Author:\r
5 //      Sebastien Pouliot (spouliot@motus.com)\r
6 //\r
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)\r
8 //\r
9 // Licensed under MIT X11 (see LICENSE) with this specific addition:\r
10 //\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
16 //\r
17 \r
18 using System;\r
19 using System.Collections;\r
20 \r
21 namespace Microsoft.Web.Services.Security {\r
22 \r
23         public class SecurityCollection : ICollection, IEnumerable {\r
24 \r
25                 private ArrayList list;\r
26 \r
27                 public SecurityCollection ()\r
28                 {\r
29                         list = new ArrayList ();\r
30                 }\r
31 \r
32                 public int Count {\r
33                         get { return list.Count; }\r
34                 }\r
35 \r
36                 public bool IsSynchronized {\r
37                         get { return list.IsSynchronized; }\r
38                 }\r
39 \r
40                 public Security this [Uri actor] {\r
41                         get {\r
42                                 if (actor == null)\r
43                                         throw new ArgumentNullException ("actor");\r
44                                 return null;\r
45                         }\r
46                 }\r
47 \r
48                 public Security this [string actor] {\r
49                         get {\r
50                                 if (actor == null)\r
51                                         throw new ArgumentNullException ("actor");\r
52                                 return null;\r
53                         }\r
54                 }\r
55 \r
56                 public object SyncRoot {\r
57                         get { return list.SyncRoot; }\r
58                 }\r
59 \r
60                 public void Add (Security security) \r
61                 {\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
68                 }\r
69 \r
70                 public void Clear () \r
71                 {\r
72                         list.Clear ();\r
73                 }\r
74 \r
75                 public bool Contains (string actor) \r
76                 {\r
77                         if (actor == null)\r
78                                 throw new ArgumentNullException ("actor");\r
79                         return false;\r
80                 }\r
81 \r
82                 public bool Contains (Uri actor) \r
83                 {\r
84                         if (actor == null)\r
85                                 throw new ArgumentNullException ("actor");\r
86                         return false;\r
87                 }\r
88 \r
89                 public void CopyTo (Array array, int index) \r
90                 {\r
91                         if (array == null)\r
92                                 throw new ArgumentNullException ("array");\r
93                 }\r
94 \r
95                 public IEnumerator GetEnumerator () \r
96                 {\r
97                         return list.GetEnumerator ();\r
98                 }\r
99 \r
100                 public void Remove (string actor) \r
101                 {\r
102                         if (actor == null)\r
103                                 throw new ArgumentNullException ("actor");\r
104                 }\r
105 \r
106                 public void Remove (Uri actor) \r
107                 {\r
108                         if (actor == null)\r
109                                 throw new ArgumentNullException ("actor");\r
110                 }\r
111         }\r
112 }\r