-//\r
-// SoapInputFilterCollection.cs: Soap Input Filter Collection\r
-//\r
-// Author:\r
-// Sebastien Pouliot (spouliot@motus.com)\r
-//\r
-// (C) 2003 Motus Technologies Inc. (http://www.motus.com)\r
-//\r
-\r
-using Microsoft.Web.Services;\r
-using System;\r
-using System.Collections;\r
-\r
-namespace Microsoft.Web.Services {\r
-\r
- public class SoapOutputFilterCollection : CollectionBase, ICloneable {\r
- \r
- public SoapOutputFilterCollection () {}\r
-\r
- public SoapOutputFilter this [int index] {\r
- get { return (SoapOutputFilter) InnerList [index]; }\r
- }\r
-\r
- public int Add (SoapOutputFilter filter) \r
- {\r
- if (filter == null)\r
- throw new ArgumentNullException ("filter");\r
- return InnerList.Add (filter);\r
- }\r
-\r
- public void AddRange (ICollection filters) \r
- {\r
- // can't use list.AddRange because we must check every items\r
- // in the collection\r
- foreach (object o in filters) {\r
- if (! (o is SoapOutputFilter))\r
- throw new ArgumentException ("not SoapOutputFilter");\r
- // we'll get the ArgumentNullException in Add\r
- InnerList.Add (o);\r
- }\r
- }\r
-\r
- // LAMESPEC: Shallow (implemented) or deep clone (todo)\r
- public object Clone () \r
- {\r
- return InnerList.Clone ();\r
- }\r
-\r
- public bool Contains (SoapOutputFilter filter) \r
- {\r
- if (filter == null)\r
- throw new ArgumentNullException ("filter");\r
- return InnerList.Contains (filter);\r
- }\r
-\r
- public bool Contains (Type filterType) \r
- {\r
- foreach (object o in InnerList) {\r
- if (o.GetType () == filterType)\r
- return true;\r
- }\r
- return false;\r
- }\r
-\r
- public int IndexOf (SoapOutputFilter filter) \r
- {\r
- if (filter == null)\r
- throw new ArgumentNullException ("filter");\r
- return InnerList.IndexOf (filter);\r
- }\r
-\r
- public int IndexOf (Type filterType) \r
- {\r
- if (filterType == null)\r
- throw new ArgumentNullException ("filterType");\r
- int i = 0;\r
- foreach (object o in InnerList) {\r
- if (o.GetType () == filterType)\r
- return i;\r
- i++;\r
- }\r
- return -1;\r
- }\r
-\r
- public void Insert (int index, SoapOutputFilter filter)\r
- {\r
- if (filter == null)\r
- throw new ArgumentNullException ("filter");\r
- InnerList.Insert (index, filter);\r
- }\r
-\r
- public void Remove (SoapOutputFilter filter) \r
- {\r
- if (filter == null)\r
- throw new ArgumentNullException ("filter");\r
- InnerList.Remove (filter);\r
- }\r
-\r
- public void Remove (Type filterType) \r
- {\r
- if (filterType == null)\r
- throw new ArgumentNullException ("filterType");\r
- int i = 0;\r
- foreach (object o in InnerList) {\r
- if (o.GetType () == filterType)\r
- InnerList.RemoveAt (i);\r
- i++;\r
- }\r
- }\r
- } \r
-}\r
+//
+// SoapInputFilterCollection.cs: Soap Input Filter Collection
+//
+// Author:
+// Sebastien Pouliot (spouliot@motus.com)
+//
+// (C) 2003 Motus Technologies Inc. (http://www.motus.com)
+//
+
+using Microsoft.Web.Services;
+using System;
+using System.Collections;
+
+namespace Microsoft.Web.Services {
+
+ public class SoapOutputFilterCollection : CollectionBase, ICloneable {
+
+ public SoapOutputFilterCollection () {}
+
+ internal SoapOutputFilterCollection (ArrayList list)
+ {
+ InnerList.AddRange (list);
+ }
+
+ public SoapOutputFilter this [int index] {
+ get { return (SoapOutputFilter) InnerList [index]; }
+ }
+
+ public int Add (SoapOutputFilter filter)
+ {
+ if (filter == null)
+ throw new ArgumentNullException ("filter");
+ return InnerList.Add (filter);
+ }
+
+ public void AddRange (ICollection filters)
+ {
+ // can't use list.AddRange because we must check every items
+ // in the collection
+ foreach (object o in filters) {
+ if (! (o is SoapOutputFilter))
+ throw new ArgumentException ("not SoapOutputFilter");
+ // we'll get the ArgumentNullException in Add
+ InnerList.Add (o);
+ }
+ }
+
+ // LAMESPEC: Shallow (implemented) or deep clone (todo)
+ public object Clone ()
+ {
+ return new SoapOutputFilterCollection ((ArrayList) InnerList.Clone ());
+ }
+
+ public bool Contains (SoapOutputFilter filter)
+ {
+ if (filter == null)
+ throw new ArgumentNullException ("filter");
+ return InnerList.Contains (filter);
+ }
+
+ public bool Contains (Type filterType)
+ {
+ foreach (object o in InnerList) {
+ if (o.GetType () == filterType)
+ return true;
+ }
+ return false;
+ }
+
+ public int IndexOf (SoapOutputFilter filter)
+ {
+ if (filter == null)
+ throw new ArgumentNullException ("filter");
+ return InnerList.IndexOf (filter);
+ }
+
+ public int IndexOf (Type filterType)
+ {
+ if (filterType == null)
+ throw new ArgumentNullException ("filterType");
+ int i = 0;
+ foreach (object o in InnerList) {
+ if (o.GetType () == filterType)
+ return i;
+ i++;
+ }
+ return -1;
+ }
+
+ public void Insert (int index, SoapOutputFilter filter)
+ {
+ if (filter == null)
+ throw new ArgumentNullException ("filter");
+ InnerList.Insert (index, filter);
+ }
+
+ public void Remove (SoapOutputFilter filter)
+ {
+ if (filter == null)
+ throw new ArgumentNullException ("filter");
+ InnerList.Remove (filter);
+ }
+
+ public void Remove (Type filterType)
+ {
+ if (filterType == null)
+ throw new ArgumentNullException ("filterType");
+ int i = 0;
+ foreach (object o in InnerList) {
+ if (o.GetType () == filterType)
+ InnerList.RemoveAt (i);
+ i++;
+ }
+ }
+ }
+}