mscorlib 2.0.0.0 4.0.0.0 System.Object System.Collections.Generic.ICollection<T> System.Collections.Generic.IEnumerable<T> System.Collections.Generic.IList<T> System.Collections.Generic.IReadOnlyCollection<T> System.Collections.Generic.IReadOnlyList<T> System.Collections.IList System.Diagnostics.DebuggerDisplay("Count={Count}") System.Diagnostics.DebuggerTypeProxy(typeof(System.Collections.Generic.CollectionDebuggerView`1)) System.Runtime.InteropServices.ComVisible(false) To be added.

The class can be used immediately by creating an instance of one of its constructed types; all you have to do is specify the type of object to be contained in the collection. In addition, you can derive your own collection type from any constructed type, or derive a generic collection type from the class itself.

The class provides protected methods that can be used to customize its behavior when adding and removing items, clearing the collection, or setting the value of an existing item.

Most objects can be modified. However, a object that is initialized with a read-only object cannot be modified. See for a read-only version of this class.

Elements in this collection can be accessed using an integer index. Indexes in this collection are zero-based.

accepts null as a valid value for reference types and allows duplicate elements.

Provides the base class for a generic collection.

- Constructor
  2.0.0.0
  4.0.0.0

  This constructor is an O(1) operation.

  Initializes a new instance of the class that is empty.

- Constructor
  2.0.0.0
  4.0.0.0
  To be added.
  To be added.
  To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void

  is set to zero, and references to other objects from elements of the collection are also released.

  This method is an O() operation, where is .

  Removes all elements from the .

- Method
  2.0.0.0
  4.0.0.0
  System.Void

  is set to zero, and references to other objects from elements of the collection are also released.

  This method is an O() operation, where is .

  Removes all elements from the .

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  Retrieving the value of this property is an O(1) operation.

  Gets the number of elements actually contained in the .

- Method
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IEnumerator<T>

  The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator.

  Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

  Initially, the enumerator is positioned before the first element in the collection. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .

  returns the same object until is called. sets to the next element.

  If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, is undefined. You cannot set to the first element of the collection again; you must create a new enumerator instance instead.

  An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

  The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

  Default implementations of collections in are not synchronized.

  This method is an O(1) operation.

  Returns an enumerator that iterates through the .

  An for the .

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  T `` To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Collections.Generic.IList<T> To be added.

  The wrapper provides the functionality of the class and exposes all the elements of the .

  Retrieving the value of this property is an O(1) operation.

  Gets a wrapper around the .

- Method
  2.0.0.0
  4.0.0.0
  System.Boolean `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method is an O() operation, where is .

  Removes the element at the specified index of the .

  The zero-based index of the element to remove.
- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method is an O() operation, where is .

  Removes the element at the specified index of the .

  The zero-based index of the element to remove.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  If the type of the source cannot be cast automatically to the type of the destination , the non-generic implementations of throw , whereas the generic implementations throw .

  This method is an O() operation, where is .

  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.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  Default implementations of collections in are not synchronized.

  Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

  returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection.

  Retrieving the value of this property is an O(1) operation.

  Gets a value indicating whether access to the is synchronized (thread safe).

- Property
  2.0.0.0
  4.0.0.0
  System.Object To be added.

  Default implementations of collections in are not synchronized.

  Enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

  returns an object that can be used to synchronize access to the . Synchronization is effective only if all threads lock this object before accessing the collection. The following code shows the use of the property for C#, C++, and Visual Basic.

  `ICollection ic = ...; lock (ic.SyncRoot) { // Access the collection. }` `Dim ic As ICollection = ... SyncLock ic.SyncRoot ' Access the collection. End SyncLock` `ICollection^ ic = ...; try { Monitor::Enter(ic->SyncRoot); // Access the collection. } finally { Monitor::Exit(ic->SyncRoot); }`

  Retrieving the value of this property is an O(1) operation.

  Gets an object that can be used to synchronize access to the .

- Method
  2.0.0.0
  4.0.0.0
  System.Collections.IEnumerator

  The foreach statement of the C# language (for each in C++, For Each in Visual Basic) hides the complexity of the enumerators. Therefore, using foreach is recommended, instead of directly manipulating the enumerator.

  Enumerators can be used to read the data in the collection, but they cannot be used to modify the underlying collection.

  Initially, the enumerator is positioned before the first element in the collection. also brings the enumerator back to this position. At this position, is undefined. Therefore, you must call to advance the enumerator to the first element of the collection before reading the value of .

  returns the same object until either or is called. sets to the next element.

  If passes the end of the collection, the enumerator is positioned after the last element in the collection and returns false. When the enumerator is at this position, subsequent calls to also return false. If the last call to returned false, is undefined. To set to the first element of the collection again, you can call followed by .

  An enumerator remains valid as long as the collection remains unchanged. If changes are made to the collection, such as adding, modifying, or deleting elements, the enumerator is irrecoverably invalidated and its behavior is undefined.

  The enumerator does not have exclusive access to the collection; therefore, enumerating through a collection is intrinsically not a thread-safe procedure. To guarantee thread safety during enumeration, you can lock the collection during the entire enumeration. To allow the collection to be accessed by multiple threads for reading and writing, you must implement your own synchronization.

  Default implementations of collections in are not synchronized.

  This method is an O(1) operation.

  Returns an enumerator that iterates through a collection.

  An that can be used to iterate through the collection.

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method is an O(1) operation.

  Adds an item to the .

  The position into which the new element was inserted.

  The to add to the .
- Method
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  This method determines equality by first determining whether is of type (or null) and then calling .

  This method is an O() operation, where is .

  Determines whether the contains a specific value.

  true if the is found in the ; otherwise, false.

  The to locate in the .
- Method
  2.0.0.0
  4.0.0.0
  System.Int32 ``

  This method determines equality using the default comparer . checks whether type implements and uses that implementation, if available. If not, checks whether type implements . If type does not implement either interface, this method uses .

  This method is an O() operation, where is .

  Determines the index of a specific item in the .

  The index of if found in the list; otherwise, -1.

  The to locate in the .
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` ``

  If equals the number of items in the , then is appended to the end.

  This method is an O() operation, where is .

  Inserts an item into the at the specified index.

  The zero-based index at which should be inserted. The to insert into the .
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  A collection with a fixed size does not allow the addition or removal of elements after the collection is created, but it allows the modification of existing elements.

  A collection with a fixed size is simply a collection with a wrapper that prevents adding and removing elements; therefore, if changes are made to the underlying collection, including the addition or removal of elements, the fixed-size collection reflects those changes.

  Retrieving the value of this property is an O(1) operation.

  Gets a value indicating whether the has a fixed size.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.

  A collection that is read-only is simply a collection with a wrapper that prevents modifying the collection; therefore, if changes are made to the underlying collection, the read-only collection reflects those changes.

  Retrieving the value of this property is an O(1) operation.

  Gets a value indicating whether the is read-only.

- Property
  2.0.0.0
  4.0.0.0
  System.Object `` To be added. To be added. To be added. To be added.
- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method determines equality using the default comparer . checks whether type implements and uses that implementation, if available. If not, checks whether type implements . If type does not implement either interface, this method uses .

  This method is an O() operation, where is .

  Removes the first occurrence of a specific object from the .

  The to remove from the .