MimeTextMatchCollection.cs 1.4 KB

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