Mono Class Library: System.Collections.Generic.List<T> Overview | Members

System.Collections.Generic.List<T>.ForEach Method

Performs the specified action on each element of the List.

public void ForEach (Action<T> action)

Parameters

action
The action delegate to perform on each element of the List.

Exceptions

TypeReason
ArgumentNullExceptionaction is null.

Remarks

The action is a delegate that performs an action on the object passed to it. The elements of the current List are individually passed to the action delegate, sequentially, in index order, and on the same thread as that used to call ForEach. Execution stops if the action throws an exception.

Requirements

Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0