protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default) { _startInfo.ArgumentList[2] = rpcRequest.ToString(); _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; // TODO: Async Action return(Execute(_startInfo)); }
private List <Result> DeserializedResult(string output) { if (!String.IsNullOrEmpty(output)) { List <Result> results = new List <Result>(); JsonRPCQueryResponseModel queryResponseModel = JsonConvert.DeserializeObject <JsonRPCQueryResponseModel>(output); if (queryResponseModel.Result == null) { return(null); } foreach (JsonRPCResult result in queryResponseModel.Result) { JsonRPCResult result1 = result; result.Action = c => { if (result1.JsonRPCAction == null) { return(false); } if (!String.IsNullOrEmpty(result1.JsonRPCAction.Method)) { if (result1.JsonRPCAction.Method.StartsWith("Flow.Launcher.")) { ExecuteFlowLauncherAPI(result1.JsonRPCAction.Method.Substring(4), result1.JsonRPCAction.Parameters); } else { string actionReponse = ExecuteCallback(result1.JsonRPCAction); JsonRPCRequestModel jsonRpcRequestModel = JsonConvert.DeserializeObject <JsonRPCRequestModel>(actionReponse); if (jsonRpcRequestModel != null && !String.IsNullOrEmpty(jsonRpcRequestModel.Method) && jsonRpcRequestModel.Method.StartsWith("Flow.Launcher.")) { ExecuteFlowLauncherAPI(jsonRpcRequestModel.Method.Substring(4), jsonRpcRequestModel.Parameters); } } } return(!result1.JsonRPCAction.DontHideAfterAction); }; results.Add(result); } return(results); } else { return(null); } }
protected override string ExecuteCallback(JsonRPCRequestModel rpcRequest) { _startInfo.Arguments = $"-B \"{context.CurrentPluginMetadata.ExecuteFilePath}\" \"{rpcRequest}\""; _startInfo.WorkingDirectory = context.CurrentPluginMetadata.PluginDirectory; return(Execute(_startInfo)); }
protected abstract string ExecuteCallback(JsonRPCRequestModel rpcRequest);
protected abstract string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default);
protected abstract Task <Stream> RequestAsync(JsonRPCRequestModel rpcRequest, CancellationToken token = default);
protected override string ExecuteCallback(JsonRPCRequestModel rpcRequest) { _startInfo.Arguments = $"\"{rpcRequest}\""; return(Execute(_startInfo)); }
protected override string Request(JsonRPCRequestModel rpcRequest, CancellationToken token = default) { // since this is not static, request strings will build up in ArgumentList if index is not specified _startInfo.ArgumentList[0] = rpcRequest.ToString(); return(Execute(_startInfo)); }
protected override Task <Stream> RequestAsync(JsonRPCRequestModel request, CancellationToken token = default) { _startInfo.ArgumentList[2] = request.ToString(); return(ExecuteAsync(_startInfo, token)); }