Beispiel #1
0
        public void writeMsg(string chatname, string msg)
        {
            MsgHistory m = getMsgHistory(chatname);

            m.sb.AppendLine(msg);
            m.unread++;
            refreshTextWindow();
        }
Beispiel #2
0
 MsgHistory getMsgHistory(string chatname)
 {
     if (!msgHistorys.ContainsKey(chatname))
     {
         MsgHistory m = new MsgHistory();
         m.sb     = new StringBuilder();
         m.unread = 0;
         msgHistorys.Add(chatname, m);
     }
     return(msgHistorys[chatname]);
 }
Beispiel #3
0
 void refreshTextWindow()
 {
     if (listBoxFriend.SelectedIndex != -1)
     {
         string chatname = ((ChatLink)listBoxFriend.Items[listBoxFriend.SelectedIndex]).getChatname();
         textBoxMsgReceive.Text = string.Empty;
         MsgHistory m = getMsgHistory(chatname);
         textBoxMsgReceive.AppendText(m.sb.ToString());
         m.unread = 0;
     }
     listBoxFriend.Refresh();
 }