示例#1
0
        private void OnMessageProcessorChanged(object sender, MessageProcessorChangedEventArgs e)
        {
            if (e.OldProcessor != null)
            {
                e.OldProcessor.ConnectionEstablished -= OnConnectionEstablished;
                e.OldProcessor.ConnectionClosed      -= OnConnectionClosed;
                e.OldProcessor.ConnectingException   -= OnConnectingException;
            }

            if (e.NewProcessor != null)
            {
                e.NewProcessor.ConnectionEstablished += OnConnectionEstablished;
                e.NewProcessor.ConnectionClosed      += OnConnectionClosed;
                e.NewProcessor.ConnectingException   += OnConnectingException;
            }
        }
示例#2
0
 protected virtual void OnMessageProcessorChanged(MessageProcessorChangedEventArgs e)
 {
     if (MessageProcessorChanged != null)
         MessageProcessorChanged(this, e);
 }
示例#3
0
        private void OnMessageProcessorChanged(object sender, MessageProcessorChangedEventArgs e)
        {
            if (e.OldProcessor != null)
            {
                e.OldProcessor.ConnectionEstablished -= OnConnectionEstablished;
                e.OldProcessor.ConnectionClosed -= OnConnectionClosed;
                e.OldProcessor.ConnectingException -= OnConnectingException;
            }

            if (e.NewProcessor != null)
            {
                e.NewProcessor.ConnectionEstablished += OnConnectionEstablished;
                e.NewProcessor.ConnectionClosed += OnConnectionClosed;
                e.NewProcessor.ConnectingException += OnConnectingException;
            }
        }