public void SendMessage(ProtocolMessage message)
 {
     messageSender.SendMessage(message);
     if (message.GetType() != typeof(OutputEvent))
     {
         Debug.WriteLine("Send Message:" + message.ToString(), "ProtocolServer.Debug");
     }
 }
        private void MessageReceiver_MessageReceived(ProtocolMessage message)
        {
            var type = message.GetType();

            Debug.WriteLine("Receive Message:" + type, "ProtocolServer.Debug");
            if (registeredMessage.ContainsKey(type))
            {
                registeredMessage[type].Invoke(message);
            }
        }