EventDescriptorCollection.cs 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. //
  2. // System.ComponentModel.EventDescriptorCollection.cs
  3. //
  4. // Author: Rodrigo Moya ([email protected])
  5. //
  6. // (C) Ximian, Inc.
  7. //
  8. using System.Collections;
  9. namespace System.ComponentModel
  10. {
  11. public class EventDescriptorCollection : IList, ICollection, IEnumerable
  12. {
  13. private ArrayList eventList;
  14. public static readonly EventDescriptorCollection Empty;
  15. public EventDescriptorCollection (EventDescriptor[] events) {
  16. for (int i = 0; i < events.Length; i++)
  17. this.Add (events[i]);
  18. }
  19. public int Add (EventDescriptor value) {
  20. return eventList.Add (value);
  21. }
  22. public void Clear () {
  23. eventList.Clear ();
  24. }
  25. public bool Contains (EventDescriptor value) {
  26. return eventList.Contains (value);
  27. }
  28. [MonoTODO]
  29. public virtual EventDescriptor Find (string name, bool ignoreCase) {
  30. throw new NotImplementedException ();
  31. }
  32. public IEnumerator GetEnumerator () {
  33. return eventList.GetEnumerator ();
  34. }
  35. public int IndexOf (EventDescriptor value) {
  36. return eventList.IndexOf (value);
  37. }
  38. public void Insert (int index, EventDescriptor value) {
  39. eventList.Insert (index, value);
  40. }
  41. public void Remove (EventDescriptor value) {
  42. eventList.Remove (value);
  43. }
  44. public void RemoveAt (int index) {
  45. eventList.RemoveAt (index);
  46. }
  47. [MonoTODO]
  48. public virtual EventDescriptorCollection Sort () {
  49. throw new NotImplementedException ();
  50. }
  51. [MonoTODO]
  52. public virtual EventDescriptorCollection Sort (IComparer comparer) {
  53. throw new NotImplementedException ();
  54. }
  55. [MonoTODO]
  56. public virtual EventDescriptorCollection Sort (string[] order) {
  57. throw new NotImplementedException ();
  58. }
  59. [MonoTODO]
  60. public virtual EventDescriptorCollection Sort (string[] order,
  61. IComparer comparer) {
  62. throw new NotImplementedException ();
  63. }
  64. [MonoTODO]
  65. protected virtual EventDescriptorCollection InternalSort (IComparer comparer) {
  66. throw new NotImplementedException ();
  67. }
  68. [MonoTODO]
  69. protected virtual EventDescriptorCollection InternalSort (string[] order) {
  70. throw new NotImplementedException ();
  71. }
  72. public int Count {
  73. get {
  74. return eventList.Count;
  75. }
  76. }
  77. public virtual EventDescriptor this[string name] {
  78. [MonoTODO]
  79. get {
  80. throw new NotImplementedException ();
  81. }
  82. }
  83. public virtual EventDescriptor this[int index] {
  84. get {
  85. return (EventDescriptor) eventList[index];
  86. }
  87. }
  88. // IList methods
  89. int IList.Add (object value) {
  90. return Add ((EventDescriptor) value);
  91. }
  92. bool IList.Contains (object value) {
  93. return Contains ((EventDescriptor) value);
  94. }
  95. int IList.IndexOf (object value) {
  96. return IndexOf ((EventDescriptor) value);
  97. }
  98. void IList.Insert (int index, object value) {
  99. Insert (index, (EventDescriptor) value);
  100. }
  101. void IList.Remove (object value) {
  102. Remove ((EventDescriptor) value);
  103. }
  104. bool IList.IsFixedSize {
  105. get { return false; }
  106. }
  107. bool IList.IsReadOnly {
  108. get { return false; }
  109. }
  110. object IList.this[int index] {
  111. get {
  112. return eventList[index];
  113. }
  114. [MonoTODO]
  115. set {
  116. throw new NotImplementedException ();
  117. }
  118. }
  119. // ICollection methods
  120. [MonoTODO]
  121. void ICollection.CopyTo (Array array, int index) {
  122. throw new NotImplementedException ();
  123. }
  124. bool ICollection.IsSynchronized {
  125. get { return false; }
  126. }
  127. object ICollection.SyncRoot {
  128. get { return null; }
  129. }
  130. }
  131. }