-
- [ComVisible (false)]
- internal class ReadOnlyList<I> : IList<I>, ICollection<I>, IEnumerable<I>
- {
- IList<I> list;
-
- internal ReadOnlyList (IList<I> list)
- {
- this.list = list;
- }
-
- public void Add (I item)
- {
- throw new NotSupportedException ();
- }
-
- public void Clear ()
- {
- throw new NotSupportedException ();
- }
-
- public bool Contains (I item)
- {
- return list.Contains (item);
- }
-
- public void CopyTo (I [] array, int index)
- {
- list.CopyTo (array, index);
- }
-
- public IEnumerator<I> GetEnumerator ()
- {
- return list.GetEnumerator ();
- }
-
- public int IndexOf (I item)
- {
- return list.IndexOf (item);
- }
-
- public void Insert (int index, I item)
- {
- throw new NotSupportedException ();
- }
-
- public bool Remove (I item)
- {
- throw new NotSupportedException ();
- }
-
- public void RemoveAt (int index)
- {
- throw new NotSupportedException ();
- }
-
- public int Count {
- get {
- return list.Count;
- }
- }
-
- public bool IsReadOnly {
- get {
- return true;
- }
- }
-
- public I this [int index] {
- get {
- return list [index];
- }
- set {
- throw new NotSupportedException ();
- }
- }
- }
-
- public struct Enumerator <T> : IEnumerator <T>, IEnumerator, IDisposable {