Click or drag to resize

IEnumerableExtensionForEachT Method (IEnumerableT, ActionT, Int32)

Runs the indexed action for each item of the collection.

Namespace:  Gile.AutoCAD.R20.Extension
Assembly:  Gile.AutoCAD.R20.Extension (in Gile.AutoCAD.R20.Extension.dll) Version: 2.0.0.0 (2.0.0.0)
Syntax
public static void ForEach<T>(
	this IEnumerable<T> source,
	Action<T, int> action
)

Parameters

source
Type: System.Collections.GenericIEnumerableT
Sequence to process.
action
Type: SystemActionT, Int32
Indexed action to run.

Type Parameters

T
Type of the items.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if source is null.
ArgumentNullExceptionThrown if action is null.
See Also