AsyncHelperBeginOperation(ActionIAsyncContext, AsyncConfig, String) Method

Exposes the specified operation with no return value as an IAsyncResult-returning async operation. The operation can be completed by calling the EndOperation method.
See the Examples section of the AsyncHelper class for details.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.2.0
C#
public static IAsyncResult BeginOperation(
	Action<IAsyncContext> operation,
	AsyncConfig? asyncConfig,
	string beginMethodName = null
)

Parameters

operation  ActionIAsyncContext
The operation to be executed.
asyncConfig  AsyncConfig
The configuration for the asynchronous operation.
beginMethodName  String  (Optional)
The name of the method that represents the operation. This must be passed also to the EndOperation method. This parameter is optional.
Default value: The name of the caller method when used with a compiler that recognizes CallerMemberNameAttribute; otherwise, .

Return Value

IAsyncResult
An IAsyncResult instance representing the asynchronous operation. To complete the operation it must be passed to the EndOperation method.

Exceptions

ArgumentNullExceptionoperation or beginMethodName is .

See Also