34 lines
674 B
C#
34 lines
674 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
namespace sharp.jsonrpc
|
|
{
|
|
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);
|
|
}
|
|
|
|
}
|
|
}
|