ImportCollection.cs 1.4 KB

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