2003-10-05 Sebastien Pouliot <spouliot@videotron.ca>
[mono.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services.Referral / ReferralCollection.cs
1 //
2 // Microsoft.Web.Services.Referral.ReferralCollection.cs
3 //
4 // Name: Duncan Mak (duncan@ximian.com)
5 //
6 // Copyright (C) Ximian, Inc. 2003
7 //
8
9 using System;
10 using System.Collections;
11 using System.Globalization;
12 using System.Web.Services.Protocols;
13 using System.Xml;
14 #if !WSE1
15 using Microsoft.Web.Services.Xml;
16 #endif
17
18 namespace Microsoft.Web.Services.Referral {
19
20         public class ReferralCollection : SoapHeader, ICollection, IEnumerable, IXmlElement
21         {
22                 ArrayList list;
23                 
24                 public ReferralCollection ()
25                 {
26                         list = new ArrayList ();
27                 }
28
29                 public void Add (Referral referral)
30                 {
31                         list.Add (referral);
32                 }
33
34                 public void AddRange (Referral [] referrals)
35                 {
36                         list.AddRange (referrals);
37                 }
38
39                 public void Clear ()
40                 {
41                         list.Clear ();
42                 }
43
44                 public bool Contains (Referral referral)
45                 {
46                         return list.Contains (referral);
47                 }
48
49                 public bool Contains (Uri uri)
50                 {
51                         return list.Contains (new Referral (uri));
52                 }
53
54 #if WSE1
55                 public void CopyTo (Array array, int index)
56 #else
57                 public virtual void CopyTo (Array array, int index)
58 #endif
59                 {
60                         list.CopyTo (array, index);
61                 }
62
63 #if WSE1
64                 public int Count {
65 #else
66                 public virtual int Count {
67 #endif
68                         get { return list.Count; }
69                 }
70
71 #if WSE1
72                 public IEnumerator GetEnumerator ()
73 #else
74                 public virtual IEnumerator GetEnumerator ()
75 #endif
76                 {
77                         return list.GetEnumerator ();
78                 }
79
80                 [MonoTODO]
81 #if WSE1
82                 public XmlElement GetXml (XmlDocument document)
83 #else
84                 public virtual XmlElement GetXml (XmlDocument document) 
85 #endif
86                 {
87                         if (document == null)
88                                 throw new ArgumentNullException (
89                                         Locale.GetText ("Argument is null."));
90
91                         throw new NotImplementedException ();
92                 }
93 #if WSE1
94                 public bool IsSynchronized {
95 #else
96                 public virtual bool IsSynchronized {
97 #endif
98                         get { return list.IsSynchronized; }
99                 }
100
101                 [MonoTODO]
102 #if WSE1
103                 public void LoadXml (XmlElement element)
104 #else
105                 public virtual void LoadXml (XmlElement element) 
106 #endif
107                 {
108                         if (element == null)
109                                 throw new ArgumentNullException (
110                                         Locale.GetText ("Argument is null."));
111
112                         throw new NotImplementedException ();
113                 }
114
115                 public void Remove (Referral referral)
116                 {
117                         list.Remove (referral);
118                 }
119
120                 public void Remove (Uri uri)
121                 {
122                         list.Remove (new Referral (uri));
123                 }
124
125 #if WSE1
126                 public object SyncRoot {
127 #else
128                 public virtual object SyncRoot {
129 #endif
130                         get { return list.SyncRoot; }
131                 }
132         }
133 }