using System; using System.Collections.Generic; using System.Runtime.InteropServices; namespace System.Collections.ObjectModel { /// Provides the base class for a generic read-only collection. /// The type of elements in the collection. // Token: 0x02000112 RID: 274 [ComVisible(false)] [Serializable] public class ReadOnlyCollection : IEnumerable, ICollection, IList, ICollection, IList, IEnumerable { /// Initializes a new instance of the class that is a read-only wrapper around the specified list. /// The list to wrap. /// /// is null. // Token: 0x06000D9A RID: 3482 RVA: 0x0003B9C4 File Offset: 0x00039BC4 public ReadOnlyCollection(IList list) { if (list == null) { throw new ArgumentNullException("list"); } this.list = list; } // Token: 0x06000D9B RID: 3483 RVA: 0x0003B9E4 File Offset: 0x00039BE4 void ICollection.Add(T item) { throw new NotSupportedException(); } // Token: 0x06000D9C RID: 3484 RVA: 0x0003B9EC File Offset: 0x00039BEC void ICollection.Clear() { throw new NotSupportedException(); } // Token: 0x06000D9D RID: 3485 RVA: 0x0003B9F4 File Offset: 0x00039BF4 void IList.Insert(int index, T item) { throw new NotSupportedException(); } // Token: 0x06000D9E RID: 3486 RVA: 0x0003B9FC File Offset: 0x00039BFC bool ICollection.Remove(T item) { throw new NotSupportedException(); } // Token: 0x06000D9F RID: 3487 RVA: 0x0003BA04 File Offset: 0x00039C04 void IList.RemoveAt(int index) { throw new NotSupportedException(); } // Token: 0x1700020B RID: 523 T IList.this[int index] { get { return this[index]; } set { throw new NotSupportedException(); } } // Token: 0x1700020C RID: 524 // (get) Token: 0x06000DA2 RID: 3490 RVA: 0x0003BA20 File Offset: 0x00039C20 bool ICollection.IsReadOnly { get { return true; } } /// Copies the elements of the to an , starting at a particular index. /// The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. /// The zero-based index in at which copying begins. /// /// is null. /// /// is less than zero. /// /// is multidimensional.-or- does not have zero-based indexing.-or-The number of elements in the source is greater than the available space from to the end of the destination .-or-The type of the source cannot be cast automatically to the type of the destination . // Token: 0x06000DA3 RID: 3491 RVA: 0x0003BA24 File Offset: 0x00039C24 void ICollection.CopyTo(Array array, int index) { ((ICollection)this.list).CopyTo(array, index); } /// Returns an enumerator that iterates through a collection. /// An that can be used to iterate through the collection. // Token: 0x06000DA4 RID: 3492 RVA: 0x0003BA38 File Offset: 0x00039C38 IEnumerator IEnumerable.GetEnumerator() { return this.list.GetEnumerator(); } /// Adds an item to the . This implementation always throws . /// The position into which the new element was inserted. /// The to add to the . /// Always thrown. // Token: 0x06000DA5 RID: 3493 RVA: 0x0003BA48 File Offset: 0x00039C48 int IList.Add(object value) { throw new NotSupportedException(); } /// Removes all items from the . This implementation always throws . /// Always thrown. // Token: 0x06000DA6 RID: 3494 RVA: 0x0003BA50 File Offset: 0x00039C50 void IList.Clear() { throw new NotSupportedException(); } /// Determines whether the contains a specific value. /// true if the is found in the ; otherwise, false. /// The to locate in the . /// /// is not of the type specified for the generic type parameter . // Token: 0x06000DA7 RID: 3495 RVA: 0x0003BA58 File Offset: 0x00039C58 bool IList.Contains(object value) { return Collection.IsValidItem(value) && this.list.Contains((T)((object)value)); } /// Determines the index of a specific item in the . /// The index of if found in the list; otherwise, -1. /// The to locate in the . /// /// is not of the type specified for the generic type parameter . // Token: 0x06000DA8 RID: 3496 RVA: 0x0003BA78 File Offset: 0x00039C78 int IList.IndexOf(object value) { if (Collection.IsValidItem(value)) { return this.list.IndexOf((T)((object)value)); } return -1; } /// Inserts an item to the at the specified index. This implementation always throws . /// The zero-based index at which should be inserted. /// The to insert into the . /// Always thrown. // Token: 0x06000DA9 RID: 3497 RVA: 0x0003BA98 File Offset: 0x00039C98 void IList.Insert(int index, object value) { throw new NotSupportedException(); } /// Removes the first occurrence of a specific object from the . This implementation always throws . /// The to remove from the . /// Always thrown. // Token: 0x06000DAA RID: 3498 RVA: 0x0003BAA0 File Offset: 0x00039CA0 void IList.Remove(object value) { throw new NotSupportedException(); } /// Removes the item at the specified index. This implementation always throws . /// The zero-based index of the item to remove. /// Always thrown. // Token: 0x06000DAB RID: 3499 RVA: 0x0003BAA8 File Offset: 0x00039CA8 void IList.RemoveAt(int index) { throw new NotSupportedException(); } /// Gets a value indicating whether access to the is synchronized (thread safe). /// true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. // Token: 0x1700020D RID: 525 // (get) Token: 0x06000DAC RID: 3500 RVA: 0x0003BAB0 File Offset: 0x00039CB0 bool ICollection.IsSynchronized { get { return false; } } /// Gets an object that can be used to synchronize access to the . /// An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. // Token: 0x1700020E RID: 526 // (get) Token: 0x06000DAD RID: 3501 RVA: 0x0003BAB4 File Offset: 0x00039CB4 object ICollection.SyncRoot { get { return this; } } /// Gets a value indicating whether the has a fixed size. /// true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns true. // Token: 0x1700020F RID: 527 // (get) Token: 0x06000DAE RID: 3502 RVA: 0x0003BAB8 File Offset: 0x00039CB8 bool IList.IsFixedSize { get { return true; } } /// Gets a value indicating whether the is read-only. /// true if the is read-only; otherwise, false. In the default implementation of , this property always returns true. // Token: 0x17000210 RID: 528 // (get) Token: 0x06000DAF RID: 3503 RVA: 0x0003BABC File Offset: 0x00039CBC bool IList.IsReadOnly { get { return true; } } /// Gets or sets the element at the specified index. /// The element at the specified index. /// The zero-based index of the element to get. /// /// is not a valid index in the . /// Always thrown if the property is set. // Token: 0x17000211 RID: 529 object IList.this[int index] { get { return this.list[index]; } set { throw new NotSupportedException(); } } /// Determines whether an element is in the . /// true if is found in the ; otherwise, false. /// The object to locate in the . The value can be null for reference types. // Token: 0x06000DB2 RID: 3506 RVA: 0x0003BADC File Offset: 0x00039CDC public bool Contains(T value) { return this.list.Contains(value); } /// Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. /// The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. /// The zero-based index in at which copying begins. /// /// is null. /// /// is less than zero. /// The number of elements in the source is greater than the available space from to the end of the destination . // Token: 0x06000DB3 RID: 3507 RVA: 0x0003BAEC File Offset: 0x00039CEC public void CopyTo(T[] array, int index) { this.list.CopyTo(array, index); } /// Returns an enumerator that iterates through the . /// An for the . // Token: 0x06000DB4 RID: 3508 RVA: 0x0003BAFC File Offset: 0x00039CFC public IEnumerator GetEnumerator() { return this.list.GetEnumerator(); } /// Searches for the specified object and returns the zero-based index of the first occurrence within the entire . /// The zero-based index of the first occurrence of within the entire , if found; otherwise, -1. /// The object to locate in the . The value can be null for reference types. // Token: 0x06000DB5 RID: 3509 RVA: 0x0003BB0C File Offset: 0x00039D0C public int IndexOf(T value) { return this.list.IndexOf(value); } /// Gets the number of elements contained in the instance. /// The number of elements contained in the instance. // Token: 0x17000212 RID: 530 // (get) Token: 0x06000DB6 RID: 3510 RVA: 0x0003BB1C File Offset: 0x00039D1C public int Count { get { return this.list.Count; } } /// Returns the that the wraps. /// The that the wraps. // Token: 0x17000213 RID: 531 // (get) Token: 0x06000DB7 RID: 3511 RVA: 0x0003BB2C File Offset: 0x00039D2C protected IList Items { get { return this.list; } } /// Gets the element at the specified index. /// The element at the specified index. /// The zero-based index of the element to get. /// /// is less than zero.-or- is equal to or greater than . // Token: 0x17000214 RID: 532 public T this[int index] { get { return this.list[index]; } } // Token: 0x0400038C RID: 908 private IList list; } }