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)
Syntaxpublic static void ForEach<T>(
this IEnumerable<T> source,
Action<T, int> action
)
<ExtensionAttribute>
Public Shared Sub ForEach(Of T) (
source As IEnumerable(Of T),
action As Action(Of T, Integer)
)
public:
[ExtensionAttribute]
generic<typename T>
static void ForEach(
IEnumerable<T>^ source,
Action<T, int>^ action
)
[<ExtensionAttribute>]
static member ForEach :
source : IEnumerable<'T> *
action : Action<'T, int> -> unit
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).
ExceptionsException | Condition |
---|
ArgumentNullException | Thrown if source is null. |
ArgumentNullException | Thrown if action is null. |
See Also