private object BlockingInvoke(ReturnDelegate del) { // Fire off the asynchronous operation MessageQueue.BlockingMessage message = new MessageQueue.BlockingMessage(del); mMessageQueue.Push(message); mHostEvent.Set(); // Wait for it to finish message.AsyncWaitHandle.WaitOne(); // Return the result, or re-throw the exception if (message.Exception != null) { throw (message.Exception); } else { return(message.Result); } }
private object BlockingInvoke(ReturnDelegate del) { // Fire off the asynchronous operation MessageQueue.BlockingMessage message = new MessageQueue.BlockingMessage(del); mMessageQueue.Push(message); mHostEvent.Set(); // Wait for it to finish message.AsyncWaitHandle.WaitOne(); // Return the result, or re-throw the exception if (message.Exception != null) throw (message.Exception); else return message.Result; }