ArrayListCollectionBase.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * Project : Mono
  3. * Namespace : System.Web.UI.MobileControls
  4. * Class : ArrayListCollectionBase
  5. * Author : Gaurav Vaish
  6. *
  7. * Copyright : 2003 with Gaurav Vaish, and with
  8. * Ximian Inc
  9. */
  10. using System.Collections;
  11. namespace System.Web.UI.MobileControls
  12. {
  13. public class ArrayListCollectionBase : ICollection, IEnumerable
  14. {
  15. private ArrayList items;
  16. internal ArrayListCollectionBase()
  17. {
  18. }
  19. internal ArrayListCollectionBase(ArrayList items)
  20. {
  21. this.items = items;
  22. }
  23. public int Count
  24. {
  25. get
  26. {
  27. return (items == null ? 0 : items.Count);
  28. }
  29. }
  30. public bool IsReadOnly
  31. {
  32. get
  33. {
  34. return (items == null ? false : items.IsReadOnly);
  35. }
  36. }
  37. public bool IsSynchronized
  38. {
  39. get
  40. {
  41. return false;
  42. }
  43. }
  44. public object SyncRoot
  45. {
  46. get
  47. {
  48. return this;
  49. }
  50. }
  51. protected ArrayList Items
  52. {
  53. get
  54. {
  55. if(items == null)
  56. items = new ArrayList();
  57. return items;
  58. }
  59. set
  60. {
  61. items = value;
  62. }
  63. }
  64. public void CopyTo(Array array, int index)
  65. {
  66. Items.CopyTo(array, index);
  67. }
  68. public IEnumerator GetEnumerator()
  69. {
  70. return Items.GetEnumerator();
  71. }
  72. }
  73. }