public static IAsyncResult BeginFor<T>(
T operation,
int fromInclusive,
int toExclusive,
AsyncConfig? asyncConfig,
Action<int> body
)
Public Shared Function BeginFor(Of T) (
operation As T,
fromInclusive As Integer,
toExclusive As Integer,
asyncConfig As AsyncConfig,
body As Action(Of Integer)
) As IAsyncResultpublic:
generic<typename T>
static IAsyncResult^ BeginFor(
T operation,
int fromInclusive,
int toExclusive,
AsyncConfig^ asyncConfig,
Action<int>^ body
)static member BeginFor :
operation : 'T *
fromInclusive : int *
toExclusive : int *
asyncConfig : AsyncConfig *
body : Action<int> -> IAsyncResult In .NET Framework 4.0 and above you can use also the ForAsyncT(T, Int32, Int32, TaskConfig, ActionInt32) method.
To get the result or the exception that occurred during the operation you have to call the EndFor method.
If fromInclusive is greater than or equal to toExclusive, then the operation completes synchronously without performing any iterations.
If operation is not , Progress is set in asyncConfig 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.
This method is not a blocking call even if the MaxDegreeOfParallelism property of the asyncConfig parameter is 1.
| ArgumentNullException | body is . |