語言

JsonRpc.AddLocalRpcMethod 方法

定義

多載

名稱 Description
AddLocalRpcMethod(String, Delegate)

新增一個帶有名稱的 RPC 方法處理器。

AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute)

新增一個帶有名稱的 RPC 方法處理器。

AddLocalRpcMethod(String, MethodInfo, Object)

新增一個帶有名稱的 RPC 方法處理器。

AddLocalRpcMethod(String, Delegate)

來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs

新增一個帶有名稱的 RPC 方法處理器。

public void AddLocalRpcMethod(string rpcMethodName, Delegate handler);
public void AddLocalRpcMethod(string? rpcMethodName, Delegate handler);
member this.AddLocalRpcMethod : string * Delegate -> unit
Public Sub AddLocalRpcMethod (rpcMethodName As String, handler As Delegate)

參數

rpcMethodName
String

方法名稱,當該方法由收到的 JSON-RPC 訊息所識別時。 它不必與此處給出的 CLR 方法/代理名稱相符。

handler
Delegate

當匹配的 RPC 訊息到達時,要調用的方法或委派。 此方法可接受來自 JSON-RPC 訊息的參數。

例外狀況

若在後StartListening()AllowModificationWhileListening被呼喚,則拋出 ,且為 false。

適用於

AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute)

來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs

新增一個帶有名稱的 RPC 方法處理器。

public void AddLocalRpcMethod(System.Reflection.MethodInfo handler, object? target, StreamJsonRpc.JsonRpcMethodAttribute? methodRpcSettings);
member this.AddLocalRpcMethod : System.Reflection.MethodInfo * obj * StreamJsonRpc.JsonRpcMethodAttribute -> unit
Public Sub AddLocalRpcMethod (handler As MethodInfo, target As Object, methodRpcSettings As JsonRpcMethodAttribute)

參數

handler
MethodInfo

當匹配的 RPC 訊息到達時,要調用的方法或委派。 此方法可接受來自 JSON-RPC 訊息的參數。

target
Object

一個定義 handler 應該處理呼叫的類型實例。

methodRpcSettings
JsonRpcMethodAttribute

說明此方法應如何處理。 它不一定是實際應用於 handler的屬性。 即使該值為 null,也不會透過對 的反射handler發現屬性。

適用於

AddLocalRpcMethod(String, MethodInfo, Object)

來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs
來源:
JsonRpc.cs

新增一個帶有名稱的 RPC 方法處理器。

public void AddLocalRpcMethod(string rpcMethodName, System.Reflection.MethodInfo handler, object target);
public void AddLocalRpcMethod(string? rpcMethodName, System.Reflection.MethodInfo handler, object? target);
member this.AddLocalRpcMethod : string * System.Reflection.MethodInfo * obj -> unit
Public Sub AddLocalRpcMethod (rpcMethodName As String, handler As MethodInfo, target As Object)

參數

rpcMethodName
String

方法名稱,當該方法由收到的 JSON-RPC 訊息所識別時。 它不必與此處給出的 CLR 方法/代理名稱相符。

handler
MethodInfo

當匹配的 RPC 訊息到達時,要調用的方法或委派。 此方法可接受來自 JSON-RPC 訊息的參數。

target
Object

一個定義 handler 應該處理呼叫的類型實例。

例外狀況

若在後StartListening()AllowModificationWhileListening被呼喚,則拋出 ,且為 false。

適用於