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[])

Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs

异步调用指定的 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[])

Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs

异步调用指定的 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[])

Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs
Source:
JSObjectReferenceExtensions.cs

异步调用指定的 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 ,它表示异步调用操作。

适用于