JSObjectReferenceExtensions.InvokeAsync 方法

定義

多載

InvokeAsync<TValue>(IJSObjectReference, String, Object[])

以非同步方式叫用指定的 JavaScript 函式。

JSRuntime 會根據 中所 DefaultAsyncTimeout 設定的值,將逾時套用至此作業。 若要分派具有不同逾時的呼叫,或沒有逾時,請考慮使用 InvokeAsync<TValue>(String, CancellationToken, Object[])

InvokeAsync<TValue>(IJSObjectReference, String, CancellationToken, Object[])

以非同步方式叫用指定的 JavaScript 函式。

InvokeAsync<TValue>(IJSObjectReference, String, TimeSpan, Object[])

以非同步方式叫用指定的 JavaScript 函式。

InvokeAsync<TValue>(IJSObjectReference, String, Object[])

以非同步方式叫用指定的 JavaScript 函式。

JSRuntime 會根據 中所 DefaultAsyncTimeout 設定的值,將逾時套用至此作業。 若要分派具有不同逾時的呼叫,或沒有逾時,請考慮使用 InvokeAsync<TValue>(String, CancellationToken, Object[])

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSObjectReference ^ jsObjectReference, System::String ^ identifier, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, params object?[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSObjectReference * string * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsObjectReference As IJSObjectReference, identifier As String, ParamArray args As Object()) As ValueTask(Of TValue)

類型參數

TValue

JSON 可序列化的傳回型別。

參數

jsObjectReference
IJSObjectReference

IJSObjectReference

identifier
String

要叫用之函式的識別碼。 例如,值 "someScope.someFunction" 會在目標實例上叫用函式 someScope.someFunction

args
Object[]

JSON 可序列化引數。

傳回

ValueTask<TValue>

由 JSON 還原序列化傳回值取得的 實例 TValue

適用於

InvokeAsync<TValue>(IJSObjectReference, String, CancellationToken, Object[])

以非同步方式叫用指定的 JavaScript 函式。

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSObjectReference ^ jsObjectReference, System::String ^ identifier, System::Threading::CancellationToken cancellationToken, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, System.Threading.CancellationToken cancellationToken, params object?[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, System.Threading.CancellationToken cancellationToken, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSObjectReference * string * System.Threading.CancellationToken * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsObjectReference As IJSObjectReference, identifier As String, cancellationToken As CancellationToken, ParamArray args As Object()) As ValueTask(Of TValue)

類型參數

TValue

JSON 可序列化的傳回型別。

參數

jsObjectReference
IJSObjectReference

IJSObjectReference

identifier
String

要叫用之函式的識別碼。 例如,值 "someScope.someFunction" 會在目標實例上叫用函式 someScope.someFunction

cancellationToken
CancellationToken

表示取消作業取消的解除標記。 指定此參數將會覆寫任何預設取消,例如因為套用逾時 (DefaultAsyncTimeout) 。

args
Object[]

JSON 可序列化引數。

傳回

ValueTask<TValue>

由 JSON 還原序列化傳回值取得的 實例 TValue

適用於

InvokeAsync<TValue>(IJSObjectReference, String, TimeSpan, Object[])

以非同步方式叫用指定的 JavaScript 函式。

public:
generic <typename TValue>
[System::Runtime::CompilerServices::Extension]
 static System::Threading::Tasks::ValueTask<TValue> InvokeAsync(Microsoft::JSInterop::IJSObjectReference ^ jsObjectReference, System::String ^ identifier, TimeSpan timeout, ... cli::array <System::Object ^> ^ args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, params object?[] args);
public static System.Threading.Tasks.ValueTask<TValue> InvokeAsync<TValue> (this Microsoft.JSInterop.IJSObjectReference jsObjectReference, string identifier, TimeSpan timeout, params object?[]? args);
static member InvokeAsync : Microsoft.JSInterop.IJSObjectReference * string * TimeSpan * obj[] -> System.Threading.Tasks.ValueTask<'Value>
<Extension()>
Public Function InvokeAsync(Of TValue) (jsObjectReference As IJSObjectReference, identifier As String, timeout As TimeSpan, ParamArray args As Object()) As ValueTask(Of TValue)

類型參數

TValue

參數

jsObjectReference
IJSObjectReference

IJSObjectReference

identifier
String

要叫用之函式的識別碼。 例如,值 "someScope.someFunction" 會在目標實例上叫用函式 someScope.someFunction

timeout
TimeSpan

要取消非同步作業的持續時間。 覆寫預設逾時 DefaultAsyncTimeout () 。

args
Object[]

JSON 可序列化引數。

傳回

ValueTask<TValue>

ValueTask 表示非同步調用作業。

適用於