//-------------<the process for incoming message>-------------- private void processMsg() { while (true) { CsMessage msg = translater_.getMessage(); if (msg.attributes.ContainsKey("command")) { if (msg.attributes["command"] == "Close client") { translater_.close(); break; } string key = msg.attributes["command"]; Dispatcher.Invoke(messageDispatcher_[key], new object[] { msg }); } } }