ArrayList.ReadOnly Method (ArrayList)


Returns a read-only ArrayList wrapper.

Namespace:   System.Collections
Assembly:  mscorlib (in mscorlib.dll)

static member ReadOnly : 
        list:ArrayList -> ArrayList


Type: System.Collections.ArrayList

The ArrayList to wrap.

Return Value

Type: System.Collections.ArrayList

A read-only ArrayList wrapper around list.

Exception Condition

list is null.

To prevent any modifications to list, expose list only through this wrapper.

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

This method is an O(1) operation.

The following code example shows how to create a read-only wrapper around an ArrayList and how to determine if an ArrayList is read-only.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top