Mono Class Library: System.Collections.ArrayList Overview | Members

System.Collections.ArrayList.FixedSize Method

Returns a ArrayList wrapper with a fixed size.

public static ArrayList FixedSize (ArrayList list)

Parameters

list
The ArrayList to wrap.

Returns

A ArrayList wrapper with a fixed size.

Exceptions

TypeReason
ArgumentNullExceptionlist is null.

Remarks

This method returns a fixed-size ArrayList that contains a reference to list. Operations that attempt to add to or delete from this new list will throw NotSupportedException. Any modifications of the elements in either the returned list or list will be reflected in the other.

Note:

The ArrayList.IsFixedSize property of the new list is true. Every other property value of the new list references the same property value of list.

Adding to or removing from list will not throw an exception and is reflected in the returned list.

By performing operations on the new list, this wrapper can be used to prevent additions to and deletions from the ArrayListlist. The elements of the list can still be modified by operations on the returned list.

Requirements

Namespace: System.Collections
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0