using System; using System.Runtime.InteropServices; namespace System.Collections { /// Provides the abstract base class for a strongly typed collection. /// 2 // Token: 0x02000125 RID: 293 [ComVisible(true)] [Serializable] public abstract class CollectionBase : IEnumerable, ICollection, IList { /// Initializes a new instance of the class with the default initial capacity. // Token: 0x06000F30 RID: 3888 RVA: 0x00040194 File Offset: 0x0003E394 protected CollectionBase() { } /// Initializes a new instance of the class with the specified capacity. /// The number of elements that the new list can initially store. // Token: 0x06000F31 RID: 3889 RVA: 0x0004019C File Offset: 0x0003E39C protected CollectionBase(int capacity) { this.list = new ArrayList(capacity); } /// 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. /// /// is multidimensional.-or-The number of elements in the source is greater than the available space from to the end of the destination . /// The type of the source cannot be cast automatically to the type of the destination . // Token: 0x06000F32 RID: 3890 RVA: 0x000401B0 File Offset: 0x0003E3B0 void ICollection.CopyTo(Array array, int index) { this.InnerList.CopyTo(array, index); } /// Gets an object that can be used to synchronize access to the . /// An object that can be used to synchronize access to the . // Token: 0x1700025A RID: 602 // (get) Token: 0x06000F33 RID: 3891 RVA: 0x000401C0 File Offset: 0x0003E3C0 object ICollection.SyncRoot { get { return this.InnerList.SyncRoot; } } /// Gets a value indicating whether access to the is synchronized (thread safe). /// true if access to the is synchronized (thread safe); otherwise, false. The default is false. // Token: 0x1700025B RID: 603 // (get) Token: 0x06000F34 RID: 3892 RVA: 0x000401D0 File Offset: 0x0003E3D0 bool ICollection.IsSynchronized { get { return this.InnerList.IsSynchronized; } } /// Adds an object to the end of the . /// The index at which the has been added. /// The to be added to the end of the . /// The is read-only.-or-The has a fixed size. // Token: 0x06000F35 RID: 3893 RVA: 0x000401E0 File Offset: 0x0003E3E0 int IList.Add(object value) { this.OnValidate(value); int count = this.InnerList.Count; this.OnInsert(count, value); this.InnerList.Add(value); try { this.OnInsertComplete(count, value); } catch { this.InnerList.RemoveAt(count); throw; } return count; } /// Determines whether the contains a specific element. /// true if the contains the specified ; otherwise, false. /// The to locate in the . // Token: 0x06000F36 RID: 3894 RVA: 0x00040254 File Offset: 0x0003E454 bool IList.Contains(object value) { return this.InnerList.Contains(value); } /// Searches for the specified 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 to locate in the . // Token: 0x06000F37 RID: 3895 RVA: 0x00040264 File Offset: 0x0003E464 int IList.IndexOf(object value) { return this.InnerList.IndexOf(value); } /// Inserts an element into the at the specified index. /// The zero-based index at which should be inserted. /// The to insert. /// /// is less than zero.-or- is greater than . /// The is read-only.-or-The has a fixed size. // Token: 0x06000F38 RID: 3896 RVA: 0x00040274 File Offset: 0x0003E474 void IList.Insert(int index, object value) { this.OnValidate(value); this.OnInsert(index, value); this.InnerList.Insert(index, value); try { this.OnInsertComplete(index, value); } catch { this.InnerList.RemoveAt(index); throw; } } /// Removes the first occurrence of a specific object from the . /// The to remove from the . /// The parameter was not found in the object. /// The is read-only.-or-The has a fixed size. // Token: 0x06000F39 RID: 3897 RVA: 0x000402DC File Offset: 0x0003E4DC void IList.Remove(object value) { this.OnValidate(value); int num = this.InnerList.IndexOf(value); if (num == -1) { throw new ArgumentException("The element cannot be found.", "value"); } this.OnRemove(num, value); this.InnerList.Remove(value); this.OnRemoveComplete(num, value); } /// Gets a value indicating whether the has a fixed size. /// true if the has a fixed size; otherwise, false. The default is false. // Token: 0x1700025C RID: 604 // (get) Token: 0x06000F3A RID: 3898 RVA: 0x00040330 File Offset: 0x0003E530 bool IList.IsFixedSize { get { return this.InnerList.IsFixedSize; } } /// Gets a value indicating whether the is read-only. /// true if the is read-only; otherwise, false. The default is false. // Token: 0x1700025D RID: 605 // (get) Token: 0x06000F3B RID: 3899 RVA: 0x00040340 File Offset: 0x0003E540 bool IList.IsReadOnly { get { return this.InnerList.IsReadOnly; } } /// Gets or sets the element at the specified index. /// The element at the specified index. /// The zero-based index of the element to get or set. /// /// is less than zero.-or- is equal to or greater than . // Token: 0x1700025E RID: 606 object IList.this[int index] { get { return this.InnerList[index]; } set { if (index < 0 || index >= this.InnerList.Count) { throw new ArgumentOutOfRangeException("index"); } this.OnValidate(value); object obj = this.InnerList[index]; this.OnSet(index, obj, value); this.InnerList[index] = value; try { this.OnSetComplete(index, obj, value); } catch { this.InnerList[index] = obj; throw; } } } /// Gets the number of elements contained in the instance. This property cannot be overridden. /// The number of elements contained in the instance.Retrieving the value of this property is an O(1) operation. /// 2 // Token: 0x1700025F RID: 607 // (get) Token: 0x06000F3E RID: 3902 RVA: 0x000403FC File Offset: 0x0003E5FC public int Count { get { return this.InnerList.Count; } } /// Returns an enumerator that iterates through the instance. /// An for the instance. /// 2 // Token: 0x06000F3F RID: 3903 RVA: 0x0004040C File Offset: 0x0003E60C public IEnumerator GetEnumerator() { return this.InnerList.GetEnumerator(); } /// Removes all objects from the instance. This method cannot be overridden. /// 2 // Token: 0x06000F40 RID: 3904 RVA: 0x0004041C File Offset: 0x0003E61C public void Clear() { this.OnClear(); this.InnerList.Clear(); this.OnClearComplete(); } /// Removes the element at the specified index of the instance. This method is not overridable. /// The zero-based index of the element to remove. /// /// is less than zero.-or- is equal to or greater than . /// 2 // Token: 0x06000F41 RID: 3905 RVA: 0x00040440 File Offset: 0x0003E640 public void RemoveAt(int index) { object obj = this.InnerList[index]; this.OnValidate(obj); this.OnRemove(index, obj); this.InnerList.RemoveAt(index); this.OnRemoveComplete(index, obj); } /// Gets or sets the number of elements that the can contain. /// The number of elements that the can contain. /// /// is set to a value that is less than . /// There is not enough memory available on the system. /// 2 // Token: 0x17000260 RID: 608 // (get) Token: 0x06000F42 RID: 3906 RVA: 0x00040480 File Offset: 0x0003E680 // (set) Token: 0x06000F43 RID: 3907 RVA: 0x000404A4 File Offset: 0x0003E6A4 [ComVisible(false)] public int Capacity { get { if (this.list == null) { this.list = new ArrayList(); } return this.list.Capacity; } set { if (this.list == null) { this.list = new ArrayList(); } this.list.Capacity = value; } } /// Gets an containing the list of elements in the instance. /// An representing the instance itself.Retrieving the value of this property is an O(1) operation. // Token: 0x17000261 RID: 609 // (get) Token: 0x06000F44 RID: 3908 RVA: 0x000404D4 File Offset: 0x0003E6D4 protected ArrayList InnerList { get { if (this.list == null) { this.list = new ArrayList(); } return this.list; } } /// Gets an containing the list of elements in the instance. /// An representing the instance itself. // Token: 0x17000262 RID: 610 // (get) Token: 0x06000F45 RID: 3909 RVA: 0x000404F4 File Offset: 0x0003E6F4 protected IList List { get { return this; } } /// Performs additional custom processes when clearing the contents of the instance. // Token: 0x06000F46 RID: 3910 RVA: 0x000404F8 File Offset: 0x0003E6F8 protected virtual void OnClear() { } /// Performs additional custom processes after clearing the contents of the instance. // Token: 0x06000F47 RID: 3911 RVA: 0x000404FC File Offset: 0x0003E6FC protected virtual void OnClearComplete() { } /// Performs additional custom processes before inserting a new element into the instance. /// The zero-based index at which to insert . /// The new value of the element at . // Token: 0x06000F48 RID: 3912 RVA: 0x00040500 File Offset: 0x0003E700 protected virtual void OnInsert(int index, object value) { } /// Performs additional custom processes after inserting a new element into the instance. /// The zero-based index at which to insert . /// The new value of the element at . // Token: 0x06000F49 RID: 3913 RVA: 0x00040504 File Offset: 0x0003E704 protected virtual void OnInsertComplete(int index, object value) { } /// Performs additional custom processes when removing an element from the instance. /// The zero-based index at which can be found. /// The value of the element to remove from . // Token: 0x06000F4A RID: 3914 RVA: 0x00040508 File Offset: 0x0003E708 protected virtual void OnRemove(int index, object value) { } /// Performs additional custom processes after removing an element from the instance. /// The zero-based index at which can be found. /// The value of the element to remove from . // Token: 0x06000F4B RID: 3915 RVA: 0x0004050C File Offset: 0x0003E70C protected virtual void OnRemoveComplete(int index, object value) { } /// Performs additional custom processes before setting a value in the instance. /// The zero-based index at which can be found. /// The value to replace with . /// The new value of the element at . // Token: 0x06000F4C RID: 3916 RVA: 0x00040510 File Offset: 0x0003E710 protected virtual void OnSet(int index, object oldValue, object newValue) { } /// Performs additional custom processes after setting a value in the instance. /// The zero-based index at which can be found. /// The value to replace with . /// The new value of the element at . // Token: 0x06000F4D RID: 3917 RVA: 0x00040514 File Offset: 0x0003E714 protected virtual void OnSetComplete(int index, object oldValue, object newValue) { } /// Performs additional custom processes when validating a value. /// The object to validate. /// /// is null. // Token: 0x06000F4E RID: 3918 RVA: 0x00040518 File Offset: 0x0003E718 protected virtual void OnValidate(object value) { if (value == null) { throw new ArgumentNullException("CollectionBase.OnValidate: Invalid parameter value passed to method: null"); } } // Token: 0x040003B7 RID: 951 private ArrayList list; } }