X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FMicrosoft.Web.Services%2FMicrosoft.Web.Services%2FSoapOutputFilterCollection.cs;h=cf7c7faca614f78f25f73095a784456c87d1b6fa;hb=0baf54ff57e10a3b63e02caa5efd215beec5e9e9;hp=f5ab80d1c3cd0439eed5c140a5173289ff4a6eb9;hpb=08c37f9c2a6112867257cd9075bbecff2bf906ce;p=mono.git diff --git a/mcs/class/Microsoft.Web.Services/Microsoft.Web.Services/SoapOutputFilterCollection.cs b/mcs/class/Microsoft.Web.Services/Microsoft.Web.Services/SoapOutputFilterCollection.cs index f5ab80d1c3c..cf7c7faca61 100644 --- a/mcs/class/Microsoft.Web.Services/Microsoft.Web.Services/SoapOutputFilterCollection.cs +++ b/mcs/class/Microsoft.Web.Services/Microsoft.Web.Services/SoapOutputFilterCollection.cs @@ -1,111 +1,116 @@ -// -// 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 () {} - - 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 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++; - } - } - } -} +// +// 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++; + } + } + } +}