语言

JsonRpc.AddLocalRpcMethod 方法

定义

重载

名称 说明
AddLocalRpcMethod(String, Delegate)

为具有给定名称的 RPC 方法添加处理程序。

AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute)

为具有给定名称的 RPC 方法添加处理程序。

AddLocalRpcMethod(String, MethodInfo, Object)

为具有给定名称的 RPC 方法添加处理程序。

AddLocalRpcMethod(String, Delegate)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
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()调用且为 false,则AllowModificationWhileListening引发 。

适用于

AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
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)

Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
JsonRpc.cs
Source:
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()调用且为 false,则AllowModificationWhileListening引发 。

适用于