ReadOnlyCollection.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. // -*- Mode: csharp; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  2. //
  3. // System.Collections.ObjectModel.ReadOnlyCollection
  4. //
  5. // Author:
  6. // Zoltan Varga ([email protected])
  7. //
  8. // (C) 2005 Novell, Inc.
  9. //
  10. //
  11. // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
  12. //
  13. // Permission is hereby granted, free of charge, to any person obtaining
  14. // a copy of this software and associated documentation files (the
  15. // "Software"), to deal in the Software without restriction, including
  16. // without limitation the rights to use, copy, modify, merge, publish,
  17. // distribute, sublicense, and/or sell copies of the Software, and to
  18. // permit persons to whom the Software is furnished to do so, subject to
  19. // the following conditions:
  20. //
  21. // The above copyright notice and this permission notice shall be
  22. // included in all copies or substantial portions of the Software.
  23. //
  24. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  25. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  26. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  27. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  28. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  29. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  30. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  31. //
  32. #if NET_2_0
  33. using System;
  34. using System.Collections.Generic;
  35. using System.Runtime.InteropServices;
  36. namespace System.Collections.ObjectModel
  37. {
  38. [ComVisible(false)]
  39. [Serializable]
  40. public class ReadOnlyCollection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable
  41. {
  42. public ReadOnlyCollection (IList<T> list)
  43. {
  44. throw new NotImplementedException ();
  45. }
  46. public void Add (T item)
  47. {
  48. throw new NotImplementedException ();
  49. }
  50. public void Clear ()
  51. {
  52. throw new NotImplementedException ();
  53. }
  54. public bool Contains (T item)
  55. {
  56. throw new NotImplementedException ();
  57. }
  58. public void CopyTo (T[] array, int index)
  59. {
  60. throw new NotImplementedException ();
  61. }
  62. public IEnumerator<T> GetEnumerator ()
  63. {
  64. throw new NotImplementedException ();
  65. }
  66. public int IndexOf (T item)
  67. {
  68. throw new NotImplementedException ();
  69. }
  70. public void Insert (int index, T item)
  71. {
  72. throw new NotImplementedException ();
  73. }
  74. public bool Remove (T item)
  75. {
  76. throw new NotImplementedException ();
  77. }
  78. public void RemoveAt (int index)
  79. {
  80. throw new NotImplementedException ();
  81. }
  82. public virtual int Count {
  83. get {
  84. throw new NotImplementedException ();
  85. }
  86. }
  87. public virtual T this [int index] {
  88. get {
  89. throw new NotImplementedException ();
  90. }
  91. set {
  92. throw new NotImplementedException ();
  93. }
  94. }
  95. public bool IsReadOnly {
  96. get {
  97. throw new NotImplementedException ();
  98. }
  99. }
  100. #region Not generic interface implementations
  101. void ICollection.CopyTo (Array array, int arrayIndex)
  102. {
  103. throw new NotImplementedException ();
  104. }
  105. IEnumerator IEnumerable.GetEnumerator()
  106. {
  107. throw new NotImplementedException ();
  108. }
  109. int IList.Add (object item)
  110. {
  111. throw new NotImplementedException ();
  112. }
  113. bool IList.Contains (object item)
  114. {
  115. throw new NotImplementedException ();
  116. }
  117. int IList.IndexOf (object item)
  118. {
  119. throw new NotImplementedException ();
  120. }
  121. void IList.Insert (int index, object item)
  122. {
  123. throw new NotImplementedException ();
  124. }
  125. void IList.Remove (object item)
  126. {
  127. throw new NotImplementedException ();
  128. }
  129. bool ICollection.IsSynchronized {
  130. get {
  131. throw new NotImplementedException ();
  132. }
  133. }
  134. object ICollection.SyncRoot {
  135. get {
  136. throw new NotImplementedException ();
  137. }
  138. }
  139. bool IList.IsFixedSize {
  140. get {
  141. throw new NotImplementedException ();
  142. }
  143. }
  144. bool IList.IsReadOnly {
  145. get {
  146. throw new NotImplementedException ();
  147. }
  148. }
  149. object IList.this [int index] {
  150. get {
  151. throw new NotImplementedException ();
  152. }
  153. set {
  154. throw new NotImplementedException ();
  155. }
  156. }
  157. #endregion
  158. }
  159. }
  160. #endif