SoapHeaderCollection.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // System.Web.Services.Protocols.SoapHeaderCollection.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.Collections;
  10. namespace System.Web.Services.Protocols {
  11. public class SoapHeaderCollection : CollectionBase {
  12. #region Constructors
  13. public SoapHeaderCollection ()
  14. {
  15. }
  16. #endregion
  17. #region Properties
  18. public SoapHeader this [int index] {
  19. get { return (SoapHeader) List[index]; }
  20. set { List[index] = value; }
  21. }
  22. #endregion // Properties
  23. #region Methods
  24. public int Add (SoapHeader header)
  25. {
  26. Insert (Count, header);
  27. return (Count - 1);
  28. }
  29. public bool Contains (SoapHeader header)
  30. {
  31. return List.Contains (header);
  32. }
  33. public void CopyTo (SoapHeader[] array, int index)
  34. {
  35. List.CopyTo (array, index);
  36. }
  37. public int IndexOf (SoapHeader header)
  38. {
  39. return List.IndexOf (header);
  40. }
  41. public void Insert (int index, SoapHeader header)
  42. {
  43. if (index < 0 || index > Count)
  44. throw new ArgumentOutOfRangeException ();
  45. List.Insert (index, header);
  46. }
  47. public void Remove (SoapHeader header)
  48. {
  49. List.Remove (header);
  50. }
  51. #endregion // Methods
  52. }
  53. }