共用方式為


ILanguageClientMiddleLayer.HandleRequestAsync Method

Definition

Intercepts JSON-RPC request calls for methodName.

public:
 System::Threading::Tasks::Task<Newtonsoft::Json::Linq::JToken ^> ^ HandleRequestAsync(System::String ^ methodName, Newtonsoft::Json::Linq::JToken ^ methodParam, Func<Newtonsoft::Json::Linq::JToken ^, System::Threading::Tasks::Task<Newtonsoft::Json::Linq::JToken ^> ^> ^ sendRequest);
public System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken> HandleRequestAsync (string methodName, Newtonsoft.Json.Linq.JToken methodParam, Func<Newtonsoft.Json.Linq.JToken,System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken>> sendRequest);
public System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken?> HandleRequestAsync (string methodName, Newtonsoft.Json.Linq.JToken methodParam, Func<Newtonsoft.Json.Linq.JToken,System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken?>> sendRequest);
abstract member HandleRequestAsync : string * Newtonsoft.Json.Linq.JToken * Func<Newtonsoft.Json.Linq.JToken, System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken>> -> System.Threading.Tasks.Task<Newtonsoft.Json.Linq.JToken>
Public Function HandleRequestAsync (methodName As String, methodParam As JToken, sendRequest As Func(Of JToken, Task(Of JToken))) As Task(Of JToken)

Parameters

methodName
String

The name of the method that is being intercepted.

methodParam
Newtonsoft.Json.Linq.JToken

Parameter to be sent for the request.

sendRequest
Func<Newtonsoft.Json.Linq.JToken,Task<Newtonsoft.Json.Linq.JToken>>

Function delegate which will send the request to the server. This delegate can be ignored and not invoked if the choice is to not send the request to the server. It must be invoked in this method if the choice is to send the request to the server.

Returns

Task<Newtonsoft.Json.Linq.JToken>

A Newtonsoft.Json.Linq.JToken corresponding to a valid response for the given method.

Applies to