AsyncHelperFromResultTResult(TResult, AsyncConfig, String) Method
Returns an
IAsyncResult instance that represents an already completed operation with a result.
To obtain the result the
EndOperation method must be called.
See the
Examples section of the
AsyncHelper class for details.
Namespace: KGySoft.ThreadingAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static IAsyncResult FromResult<TResult>(
TResult result,
AsyncConfig? asyncConfig,
string beginMethodName = null
)
Public Shared Function FromResult(Of TResult) (
result As TResult,
asyncConfig As AsyncConfig,
Optional beginMethodName As String = Nothing
) As IAsyncResult
public:
generic<typename TResult>
static IAsyncResult^ FromResult(
TResult result,
AsyncConfig^ asyncConfig,
String^ beginMethodName = nullptr
)
static member FromResult :
result : 'TResult *
asyncConfig : AsyncConfig *
?beginMethodName : string
(* Defaults:
let _beginMethodName = defaultArg beginMethodName null
*)
-> IAsyncResult
- result TResult
- The result to be returned by the EndOperation method if the operation has not been canceled.
- 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, .
- TResult
- The type of the result.
IAsyncResultAn
IAsyncResult instance representing the asynchronous operation.
To complete the operation it must be passed to the
EndOperation method.