Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }