2017-09-18 11:30:23 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-10-17 21:43:50 +02:00
|
|
|
|
namespace sharp.jsonrpc
|
2017-09-18 11:30:23 +02:00
|
|
|
|
{
|
|
|
|
|
public class RPCCall
|
|
|
|
|
{
|
|
|
|
|
public RPCConnector Connector { get; private set; }
|
|
|
|
|
public String MethodName { get; private set; }
|
|
|
|
|
public Dictionary<string, object> args;
|
|
|
|
|
|
|
|
|
|
public RPCCall(RPCConnector connector)
|
|
|
|
|
{
|
|
|
|
|
this.Connector = connector;
|
|
|
|
|
this.args = new Dictionary<string, object>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RPCCall method(string method){
|
|
|
|
|
this.MethodName = method;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public RPCCall parameter(string name,object value){
|
|
|
|
|
this.args.Add(name,value);
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Response execute(){
|
|
|
|
|
return Connector.Call(this.MethodName,this.args);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|