JsonRpc.NotifyWithParameterObjectAsync 方法

定義

多載

NotifyWithParameterObjectAsync(String, Object, IReadOnlyDictionary<String,Type>)

在 JSON-RPC 伺服器上叫用指定的方法,而不需要等待其回應。

NotifyWithParameterObjectAsync(String, Object)

在伺服器上叫用方法,並不要等候其完成、引發和忘記樣式。 參數會以 物件的形式傳遞。

NotifyWithParameterObjectAsync(String, Object, IReadOnlyDictionary<String,Type>)

在 JSON-RPC 伺服器上叫用指定的方法,而不需要等待其回應。

public System.Threading.Tasks.Task NotifyWithParameterObjectAsync (string targetName, object? argument, System.Collections.Generic.IReadOnlyDictionary<string,Type>? argumentDeclaredTypes);
member this.NotifyWithParameterObjectAsync : string * obj * System.Collections.Generic.IReadOnlyDictionary<string, Type> -> System.Threading.Tasks.Task
Public Function NotifyWithParameterObjectAsync (targetName As String, argument As Object, argumentDeclaredTypes As IReadOnlyDictionary(Of String, Type)) As Task

參數

targetName
String

要叫用的方法名稱。 不得為 Null 或空白。

argument
Object

物件,其屬性符合目標方法上的參數名稱。 必須使用選取 IJsonRpcMessageFormatter 的 來序列化。

argumentDeclaredTypes
IReadOnlyDictionary<String,Type>

物件的字典 Type ,描述 伺服器預期在 中唯一元素 argumentsIReadOnlyDictionary<TKey,TValue> 提供之 每個專案如何輸入。 如果指定,這必須與 的第一個元素 arguments 中包含的字典具有相同的索引鍵集,而且不包含 null 任何值。

傳回

傳送通知時完成的工作。

備註

忽略伺服器端上發生的任何錯誤。

適用於

NotifyWithParameterObjectAsync(String, Object)

在伺服器上叫用方法,並不要等候其完成、引發和忘記樣式。 參數會以 物件的形式傳遞。

public System.Threading.Tasks.Task NotifyWithParameterObjectAsync (string targetName, object argument = default);
public System.Threading.Tasks.Task NotifyWithParameterObjectAsync (string targetName, object? argument = default);
member this.NotifyWithParameterObjectAsync : string * obj -> System.Threading.Tasks.Task
Public Function NotifyWithParameterObjectAsync (targetName As String, Optional argument As Object = Nothing) As Task

參數

targetName
String

在伺服器上叫用的方法名稱。 不得為 Null 或空字串。

argument
Object

方法引數必須可序列化為 JSON。

傳回

當通知要求傳送至伺服器時完成的工作。

例外狀況

如果 targetName 為 null。

如果 已處置這個 的實例 JsonRpc

備註

忽略伺服器端上發生的任何錯誤。

適用於