mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 03:07:04 +02:00
22 lines
726 B
Plaintext
22 lines
726 B
Plaintext
using System.Collections.Generic;
|
|
using System.Linq;
|
|
|
|
namespace Wox.RPC
|
|
{
|
|
public class JsonRPC
|
|
{
|
|
public static string Send(string method, List<string> paras)
|
|
{
|
|
var list = paras.Select(s => string.Format(@"\""{0}\""", s));
|
|
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""params\"": [{1}], \""id\"": 1}}",
|
|
method, string.Join(",", list.ToArray()));
|
|
}
|
|
|
|
public static string Send(string method, string para)
|
|
{
|
|
return string.Format(@"{{\""jsonrpc\"": \""2.0\"",\""method\"": \""{0}\"", \""params\"": {1}, \""id\"": 1}}",
|
|
method, string.Join(",", list.ToArray()));
|
|
}
|
|
}
|
|
}
|