OperationCollection.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // System.Web.Services.Description.OperationCollection.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. namespace System.Web.Services.Description {
  10. public sealed class OperationCollection : ServiceDescriptionBaseCollection {
  11. #region Constructors
  12. internal OperationCollection (PortType portType)
  13. : base (portType)
  14. {
  15. }
  16. #endregion // Constructors
  17. #region Properties
  18. public Operation this [int index] {
  19. get {
  20. if (index < 0 || index > Count)
  21. throw new ArgumentOutOfRangeException ();
  22. return (Operation) List[index];
  23. }
  24. set { List[index] = value; }
  25. }
  26. #endregion // Properties
  27. #region Methods
  28. public int Add (Operation operation)
  29. {
  30. Insert (Count, operation);
  31. return (Count - 1);
  32. }
  33. public bool Contains (Operation operation)
  34. {
  35. return List.Contains (operation);
  36. }
  37. public void CopyTo (Operation[] array, int index)
  38. {
  39. List.CopyTo (array, index);
  40. }
  41. public int IndexOf (Operation operation)
  42. {
  43. return List.IndexOf (operation);
  44. }
  45. public void Insert (int index, Operation operation)
  46. {
  47. List.Insert (index, operation);
  48. }
  49. public void Remove (Operation operation)
  50. {
  51. List.Remove (operation);
  52. }
  53. protected override void SetParent (object value, object parent)
  54. {
  55. ((Operation) value).SetParent ((PortType) parent);
  56. }
  57. #endregion // Methods
  58. }
  59. }