JsonRpc.AddLocalRpcMethod Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddLocalRpcMethod(String, Delegate) |
Adds a handler for an RPC method with a given name. |
AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute) |
Adds a handler for an RPC method with a given name. |
AddLocalRpcMethod(String, MethodInfo, Object) |
Adds a handler for an RPC method with a given name. |
AddLocalRpcMethod(String, Delegate)
Adds a handler for an RPC method with a given name.
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)
Parameters
- rpcMethodName
- String
The name of the method as it is identified by the incoming JSON-RPC message. It need not match the name of the CLR method/delegate given here.
- handler
- Delegate
The method or delegate to invoke when a matching RPC message arrives. This method may accept parameters from the incoming JSON-RPC message.
Exceptions
Thrown if called after StartListening() is called and AllowModificationWhileListening is false
.
Applies to
AddLocalRpcMethod(MethodInfo, Object, JsonRpcMethodAttribute)
Adds a handler for an RPC method with a given name.
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)
Parameters
- handler
- MethodInfo
The method or delegate to invoke when a matching RPC message arrives. This method may accept parameters from the incoming JSON-RPC message.
- target
- Object
An instance of the type that defines handler
which should handle the invocation.
- methodRpcSettings
- JsonRpcMethodAttribute
A description for how this method should be treated.
It need not be an attribute that was actually applied to handler
.
An attribute will not be discovered via reflection on the handler
, even if this value is null
.
Applies to
AddLocalRpcMethod(String, MethodInfo, Object)
Adds a handler for an RPC method with a given name.
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)
Parameters
- rpcMethodName
- String
The name of the method as it is identified by the incoming JSON-RPC message. It need not match the name of the CLR method/delegate given here.
- handler
- MethodInfo
The method or delegate to invoke when a matching RPC message arrives. This method may accept parameters from the incoming JSON-RPC message.
- target
- Object
An instance of the type that defines handler
which should handle the invocation.
Exceptions
Thrown if called after StartListening() is called and AllowModificationWhileListening is false
.