RepeaterItemCollection.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Namespace: System.Web.UI.WebControls
  3. * Class: RepeaterItemCollection
  4. *
  5. * Author: Gaurav Vaish
  6. * Maintainer: [email protected]
  7. * Contact: <[email protected]>, <[email protected]>
  8. * Implementation: yes
  9. * Status: 100%
  10. *
  11. * (C) Gaurav Vaish (2002)
  12. */
  13. using System;
  14. using System.Collections;
  15. using System.Web;
  16. using System.Web.UI;
  17. namespace System.Web.UI.WebControls
  18. {
  19. public sealed class RepeaterItemCollection : ICollection, IEnumerable
  20. {
  21. private ArrayList items;
  22. public RepeaterItemCollection(ArrayList items)
  23. {
  24. this.items = items;
  25. }
  26. public int Count
  27. {
  28. get
  29. {
  30. return items.Count;
  31. }
  32. }
  33. public bool IsReadOnly
  34. {
  35. get
  36. {
  37. return false;
  38. }
  39. }
  40. public bool IsSynchronized
  41. {
  42. get
  43. {
  44. return false;
  45. }
  46. }
  47. public RepeaterItem this[int index]
  48. {
  49. get
  50. {
  51. return (RepeaterItem)(items[index]);
  52. }
  53. }
  54. public object SyncRoot
  55. {
  56. get
  57. {
  58. return this;
  59. }
  60. }
  61. public void CopyTo(Array array, int index)
  62. {
  63. foreach(RepeaterItem current in this)
  64. {
  65. array.SetValue(current, index++);
  66. }
  67. }
  68. public IEnumerator GetEnumerator()
  69. {
  70. return items.GetEnumerator();
  71. }
  72. }
  73. }