(DISTFILES): Comment out a few missing files.
[mono-project.git] / mcs / class / Microsoft.Web.Services / Microsoft.Web.Services / SoapInputFilterCollection.cs
blob24000d7d32f91ea47ea6d9777adc2b65c6c66885
1 //
2 // SoapInputFilterCollection.cs: Soap Input Filter Collection
3 //
4 // Author:
5 // Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2002, 2003 Motus Technologies Inc. (http://www.motus.com)
8 //
10 using System;
11 using System.Collections;
13 namespace Microsoft.Web.Services {
15 public class SoapInputFilterCollection : CollectionBase, ICloneable {
17 public SoapInputFilterCollection () {}
19 internal SoapInputFilterCollection (ArrayList list)
21 InnerList.AddRange (list);
24 public SoapInputFilter this [int index] {
25 get { return (SoapInputFilter) InnerList [index]; }
28 public int Add (SoapInputFilter filter)
30 if (filter == null)
31 throw new ArgumentNullException ("filter");
32 return InnerList.Add (filter);
35 public void AddRange (ICollection filters)
37 // can't use list.AddRange because we must check every items
38 // in the collection
39 foreach (object o in filters) {
40 if (! (o is SoapInputFilter))
41 throw new ArgumentException ("not SoapInputFilter");
42 // we'll get the ArgumentNullException in Add
43 InnerList.Add (o as SoapInputFilter);
47 // LAMESPEC: Shallow (implemented) or deep clone (todo)
48 public object Clone ()
50 return new SoapInputFilterCollection ((ArrayList) InnerList.Clone ());
53 public bool Contains (SoapInputFilter filter)
55 if (filter == null)
56 throw new ArgumentNullException ("filter");
57 return InnerList.Contains (filter);
60 public bool Contains (Type filterType)
62 foreach (object o in InnerList) {
63 if (o.GetType () == filterType)
64 return true;
66 return false;
69 public int IndexOf (SoapInputFilter filter)
71 if (filter == null)
72 throw new ArgumentNullException ("filter");
73 return InnerList.IndexOf (filter);
76 public int IndexOf (Type filterType)
78 if (filterType == null)
79 throw new ArgumentNullException ("filterType");
80 int i = 0;
81 foreach (object o in InnerList) {
82 if (o.GetType () == filterType)
83 return i;
84 i++;
86 return -1;
89 public void Insert (int index, SoapInputFilter filter)
91 if (filter == null)
92 throw new ArgumentNullException ("filter");
93 InnerList.Insert (index, filter);
96 public void Remove (SoapInputFilter filter)
98 if (filter == null)
99 throw new ArgumentNullException ("filter");
100 InnerList.Remove (filter);
103 public void Remove (Type filterType)
105 if (filterType == null)
106 throw new ArgumentNullException ("filterType");
107 int i = 0;
108 foreach (object o in InnerList) {
109 if (o.GetType () == filterType)
110 InnerList.RemoveAt (i);
111 i++;