public IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink replySink)
        {
            var contextSyncContext  = new ContextSynchronizationContext(SynchronizationContext.Current);
            var syncContextReplacer = new SynchronizationContextReplacer(contextSyncContext);

            DelegateMessageSink.SyncProcessMessageDelegate replySyncDelegate = (n, m) => SyncProcessMessageDelegateForAsyncReply(n, m, syncContextReplacer);
            var newReplySink = new DelegateMessageSink(replySink, replySyncDelegate, null);

            return(m_NextSink.AsyncProcessMessage(msg, newReplySink));
        }
        public IMessage SyncProcessMessage(IMessage msg)
        {
            var contextSyncContext = new ContextSynchronizationContext(SynchronizationContext.Current);

            using (new SynchronizationContextReplacer(contextSyncContext))
            {
                var ret = m_NextSink.SyncProcessMessage(msg);
                return(ret);
            }
        }