private void Connector_GroupMessageEvent(object sender, MessageDictionary e)
 {
     Application.Current.Dispatcher.Invoke(() =>
     {
         GroupChatWindow.MessageArrive(e);
     });
 }
        private void Connector_PrivateMessageEvent(object sender, MessageDictionary e)
        {
            bool   found        = false;
            Sender s            = (Sender)Enum.Parse(typeof(Sender), e[MesKeyStr.Sender]);
            string targetUserID = s == Sender.others ? e[MesKeyStr.UserID] : e[MesKeyStr.TargetUserID];

            foreach (ChatWindow cw in privateWindows)
            {
                if (cw.TargetUser.UserID.Equals(targetUserID))
                {
                    found = true;
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        cw.MessageArrive(e);
                    });
                }
            }
            if (found == false)
            {
                User       target     = new User(e[MesKeyStr.UserID], e[MesKeyStr.NickName]);
                ChatWindow chatWindow = null;
                Application.Current.Dispatcher.Invoke(() =>
                {
                    chatWindow = new ChatWindow(target);
                    chatWindow.ManualCloseEvent += ChatWindow_ManualCloseEvent;
                    chatWindow.Show();
                    Application.Current.Dispatcher.Invoke(() =>
                    {
                        chatWindow.MessageArrive(e);
                    });
                });
                privateWindows.Add(chatWindow);
            }
        }