public void Call(string method, params object[] parameters) { MethodCall methodCall = new MethodCall(method, parameters); _sendBuffer.AddLast(methodCall); try { methodCall.AwaitResponse().Wait(); } catch { _methodCalls.Remove(methodCall); throw; } _methodCalls.Remove(methodCall); }
public TReturnValue Call <TReturnValue>(string method, params object[] parameters) { MethodCall methodCall = new MethodCall(method, parameters); _sendBuffer.AddLast(methodCall); TReturnValue returnValue; try { returnValue = methodCall.AwaitResponse <TReturnValue>().Result; } catch { _methodCalls.Remove(methodCall); throw; } _methodCalls.Remove(methodCall); return(returnValue); }