Esempio n. 1
0
        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);
            }
        }
Esempio n. 2
0
 private void Invoke(Delegate del)
 {
     mMessageQueue.Push(del, null);
     mEvent.Set();
 }