Note
public static bool For<T>(
T operation,
int fromInclusive,
int toExclusive,
ParallelConfig? configuration,
Action<int> body
)
Public Shared Function For(Of T) (
operation As T,
fromInclusive As Integer,
toExclusive As Integer,
configuration As ParallelConfig,
body As Action(Of Integer)
) As Booleanpublic:
generic<typename T>
static bool For(
T operation,
int fromInclusive,
int toExclusive,
ParallelConfig^ configuration,
Action<int>^ body
)static member For :
operation : 'T *
fromInclusive : int *
toExclusive : int *
configuration : ParallelConfig *
body : Action<int> -> bool This method is similar to Parallel.For(int, int, ParallelOptions, Action<int>) but it can be used even in .NET Framework 3.5 and supports reporting progress.
If fromInclusive is greater than or equal to toExclusive, then the method returns without performing any iterations.
If operation is not , Progress is set in configuration and there is at least one iteration, then the IAsyncProgress.New method will be called before the first iteration passing the specified operation to the operationType parameter. It will be followed by as many IAsyncProgress.Increment calls as many iterations were completed successfully.
| ArgumentNullException | body is . |
| OperationCanceledException | The operation has been canceled and ThrowIfCanceled in configuration was . |