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; } }
protected virtual void OnMessageProcessorChanged(MessageProcessorChangedEventArgs e) { if (MessageProcessorChanged != null) MessageProcessorChanged(this, e); }