BaseCollection.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // System.Windows.Forms.BaseCollection
  3. //
  4. // Author:
  5. // stubbed out by Jaak Simm ([email protected])
  6. // Dennis hayes ([email protected])
  7. //
  8. // (C) Ximian, Inc., 2002
  9. //
  10. using System;
  11. using System.Collections;
  12. namespace System.Windows.Forms {
  13. /// <summary>
  14. /// Provides the base functionality for creating data-related collections in the System.Windows.Forms namespace.
  15. /// ToDo note:
  16. /// - Synchronization is not implemented
  17. /// - MarshalByRefObject members not stubbed out
  18. /// </summary>
  19. [MonoTODO]
  20. public class BaseCollection : MarshalByRefObject, ICollection, IEnumerable {
  21. ArrayList list;
  22. // --- Constructor ---
  23. public BaseCollection()
  24. {
  25. this.list = null;
  26. }
  27. // --- public and protected Properties ---
  28. //virtual
  29. int ICollection.Count {
  30. get {
  31. return list.Count;
  32. }
  33. }
  34. public bool IsReadOnly {
  35. //always false as per spec.
  36. get { return false; }
  37. }
  38. [MonoTODO]
  39. public bool IsSynchronized {
  40. //always false as per spec.
  41. get { return false; }
  42. }
  43. protected virtual ArrayList List {
  44. get {
  45. return list;
  46. }
  47. }
  48. [MonoTODO]
  49. public object SyncRoot {
  50. get { return this; }
  51. }
  52. // --- public Methods ---
  53. public void CopyTo (Array ar, int index)
  54. {
  55. list.CopyTo(ar, index);
  56. }
  57. public IEnumerator GetEnumerator()
  58. {
  59. return list.GetEnumerator();
  60. }
  61. }
  62. }