<PackageReference Include="System.Collections.NonGeneric" Version="4.0.1-beta-23409" />

ArrayList

Implements the IList interface using an array whose size is dynamically increased as required.To browse the .NET Framework source code for this type, see the Reference Source.
public virtual int Capacity { get; set; }

Gets or sets the number of elements that the ArrayList can contain.

public virtual int Count { get; }

Gets the number of elements actually contained in the ArrayList.

public virtual bool IsFixedSize { get; }

Gets a value indicating whether the ArrayList has a fixed size.

public virtual bool IsReadOnly { get; }

Gets a value indicating whether the ArrayList is read-only.

public virtual bool IsSynchronized { get; }

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

public virtual object this[int index] { get; set; }

Gets or sets the element at the specified index.

public virtual object SyncRoot { get; }

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

public ArrayList()

Initializes a new instance of the ArrayList class that is empty and has the default initial capacity.

public ArrayList(int capacity)

Initializes a new instance of the ArrayList class that is empty and has the specified initial capacity.

Initializes a new instance of the ArrayList class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied.

public static ArrayList Adapter(IList list)

Creates an ArrayList wrapper for a specific IList.

public static IList FixedSize(IList list)

Returns an IList wrapper with a fixed size.

public static ArrayList FixedSize(ArrayList list)

Returns an ArrayList wrapper with a fixed size.

public static IList ReadOnly(IList list)

Returns a read-only IList wrapper.

public static ArrayList ReadOnly(ArrayList list)

Returns a read-only ArrayList wrapper.

public static ArrayList Repeat(object value, int count)

Returns an ArrayList whose elements are copies of the specified value.

public static IList Synchronized(IList list)

Returns an IList wrapper that is synchronized (thread safe).

public static ArrayList Synchronized(ArrayList list)

Returns an ArrayList wrapper that is synchronized (thread safe).

public virtual int Add(object value)

Adds an object to the end of the ArrayList.

public virtual void AddRange(ICollection c)

Adds the elements of an ICollection to the end of the ArrayList.

public virtual int BinarySearch(int index, int count, object value, IComparer comparer)

Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.

public virtual int BinarySearch(object value)

Searches the entire sorted ArrayList for an element using the default comparer and returns the zero-based index of the element.

public virtual int BinarySearch(object value, IComparer comparer)

Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.

public virtual void Clear()

Removes all elements from the ArrayList.

public virtual object Clone()

Creates a shallow copy of the ArrayList.

public virtual bool Contains(object item)

Determines whether an element is in the ArrayList.

public virtual void CopyTo(Array array)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.

public virtual void CopyTo(Array array, int arrayIndex)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.

public virtual void CopyTo(int index, Array array, int arrayIndex, int count)

Copies a range of elements from the ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.

public virtual IEnumerator GetEnumerator()

Returns an enumerator for the entire ArrayList.

public virtual IEnumerator GetEnumerator(int index, int count)

Returns an enumerator for a range of elements in the ArrayList.

public virtual ArrayList GetRange(int index, int count)

Returns an ArrayList which represents a subset of the elements in the source ArrayList.

public virtual int IndexOf(object value)

Searches for the specified Object and returns the zero-based index of the first occurrence within the entire ArrayList.

public virtual int IndexOf(object value, int startIndex)

Searches for the specified Object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that extends from the specified index to the last element.

public virtual int IndexOf(object value, int startIndex, int count)

Searches for the specified Object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that starts at the specified index and contains the specified number of elements.

public virtual void Insert(int index, object value)

Inserts an element into the ArrayList at the specified index.

public virtual void InsertRange(int index, ICollection c)

Inserts the elements of a collection into the ArrayList at the specified index.

public virtual int LastIndexOf(object value)

Searches for the specified Object and returns the zero-based index of the last occurrence within the entire ArrayList.

public virtual int LastIndexOf(object value, int startIndex)

Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that extends from the first element to the specified index.

public virtual int LastIndexOf(object value, int startIndex, int count)

Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that contains the specified number of elements and ends at the specified index.

public virtual void Remove(object obj)

Removes the first occurrence of a specific object from the ArrayList.

public virtual void RemoveAt(int index)

Removes the element at the specified index of the ArrayList.

public virtual void RemoveRange(int index, int count)

Removes a range of elements from the ArrayList.

public virtual void Reverse()

Reverses the order of the elements in the entire ArrayList.

public virtual void Reverse(int index, int count)

Reverses the order of the elements in the specified range.

public virtual void SetRange(int index, ICollection c)

Copies the elements of a collection over a range of elements in the ArrayList.

public virtual void Sort()

Sorts the elements in the entire ArrayList.

public virtual void Sort(IComparer comparer)

Sorts the elements in the entire ArrayList using the specified comparer.

public virtual void Sort(int index, int count, IComparer comparer)

Sorts the elements in a range of elements in ArrayList using the specified comparer.

public virtual object[] ToArray()

Copies the elements of the ArrayList to a new Object array.

public virtual Array ToArray(Type type)

Copies the elements of the ArrayList to a new array of the specified element type.

public virtual void TrimToSize()

Sets the capacity to the actual number of elements in the ArrayList.