AsyncHelperEndOperation(IAsyncResult, String) Method

Waits for the completion of an operation started by a corresponding BeginOperation, FromResult or FromCompleted call. If the operation is still running, then this method blocks the caller and waits for the completion. The possibly occurred exceptions are also thrown then this method is called.
See the Examples section of the AsyncHelper class for details.

Definition

Namespace: KGySoft.Threading
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public static void EndOperation(
	IAsyncResult asyncResult,
	string beginMethodName
)

Parameters

asyncResult  IAsyncResult
The result of a corresponding BeginOperation or FromCompleted call.
beginMethodName  String
The same name that was passed to the BeginOperation, FromResult or FromCompleted method.

Exceptions

ArgumentNullExceptionasyncResult is .
InvalidOperationExceptionasyncResult was not returned by the corresponding BeginOperation or FromCompleted methods with a matching beginMethodName
-or-
this method was already called for this asyncResult instance.
OperationCanceledExceptionThe operation has been canceled and ThrowIfCanceled in the corresponding AsyncConfig was .

See Also