AbstractFileSystemJobCancellableForEachT Method (CancellationToken, IEnumerableT, ActionT) |
Enumerates through collection checking cancellationToken
before each iteration and performing action on each item in the collection.
Namespace: CMS.ContinuousIntegration.InternalAssembly: CMS.ContinuousIntegration (in CMS.ContinuousIntegration.dll) Version: 13.0.131
Syntax protected void CancellableForEach<T>(
CancellationToken cancellationToken,
IEnumerable<T> collection,
Action<T> action
)
Parameters
- cancellationToken
- Type: System.ThreadingCancellationToken
Token providing cancellation functionality. - collection
- Type: System.Collections.GenericIEnumerableT
Collection of items the action should be performed on. - action
- Type: SystemActionT
Action that should be performed on each item of collection.
Type Parameters
- T
- Type of items in the collection.
Exceptions Exception | Condition |
---|
OperationCanceledException | Thrown when cancellationToken enters canceled state. |
See Also