Click or drag to resize
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.Internal
Assembly: CMS.ContinuousIntegration (in CMS.ContinuousIntegration.dll) Version: 10.0.0
Syntax
C#
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
ExceptionCondition
OperationCanceledExceptionThrown when cancellationToken enters canceled state.
See Also