OperationBindingCollection.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //
  2. // System.Web.Services.Description.OperationBindingCollection.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 OperationBindingCollection : ServiceDescriptionBaseCollection {
  11. #region Fields
  12. Binding binding;
  13. #endregion // Fields
  14. #region Constructors
  15. internal OperationBindingCollection (Binding binding)
  16. {
  17. this.binding = binding;
  18. }
  19. #endregion // Constructors
  20. #region Properties
  21. public OperationBinding this [int index] {
  22. get {
  23. if (index < 0 || index > Count)
  24. throw new ArgumentOutOfRangeException ();
  25. return (OperationBinding) List[index];
  26. }
  27. set { List[index] = value; }
  28. }
  29. #endregion // Properties
  30. #region Methods
  31. public int Add (OperationBinding bindingOperation)
  32. {
  33. Insert (Count, bindingOperation);
  34. return (Count - 1);
  35. }
  36. public bool Contains (OperationBinding bindingOperation)
  37. {
  38. return List.Contains (bindingOperation);
  39. }
  40. public void CopyTo (OperationBinding[] array, int index)
  41. {
  42. List.CopyTo (array, index);
  43. }
  44. public int IndexOf (OperationBinding bindingOperation)
  45. {
  46. return List.IndexOf (bindingOperation);
  47. }
  48. public void Insert (int index, OperationBinding bindingOperation)
  49. {
  50. SetParent (bindingOperation, binding);
  51. List.Insert (index, bindingOperation);
  52. }
  53. public void Remove (OperationBinding bindingOperation)
  54. {
  55. List.Remove (bindingOperation);
  56. }
  57. protected override void SetParent (object value, object parent)
  58. {
  59. ((OperationBinding) value).SetParent ((Binding) parent);
  60. }
  61. #endregion // Methods
  62. }
  63. }