ValidatorCollection.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // System.Web.UI.ValidatorCollection.cs
  3. //
  4. // Authors:
  5. // Duncan Mak ([email protected])
  6. // Gonzalo Paniagua Javier ([email protected])
  7. //
  8. // (C) 2002 Ximian, Inc. (http://www.ximian.com)
  9. using System;
  10. using System.Collections;
  11. namespace System.Web.UI {
  12. public sealed class ValidatorCollection : ICollection, IEnumerable
  13. {
  14. private ArrayList _validators;
  15. public ValidatorCollection ()
  16. {
  17. _validators = new ArrayList ();
  18. }
  19. public int Count {
  20. get { return _validators.Count; }
  21. }
  22. public bool IsReadOnly {
  23. get { return _validators.IsReadOnly; }
  24. }
  25. public bool IsSynchronized {
  26. get { return _validators.IsSynchronized; }
  27. }
  28. public IValidator this [int index] {
  29. get { return (IValidator) _validators [index]; }
  30. }
  31. public object SyncRoot {
  32. get { return this; }
  33. }
  34. public void Add (IValidator validator)
  35. {
  36. _validators.Add (validator);
  37. }
  38. public bool Contains (IValidator validator)
  39. {
  40. return _validators.Contains (validator);
  41. }
  42. public void CopyTo (Array array, int index)
  43. {
  44. _validators.CopyTo (array, index);
  45. }
  46. public IEnumerator GetEnumerator ()
  47. {
  48. return _validators.GetEnumerator ();
  49. }
  50. public void Remove (IValidator validator)
  51. {
  52. _validators.Remove (validator);
  53. }
  54. }
  55. }