/// <summary> /// 双击notifyIcon显示聊天面板 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { SingleUtils.isQQTD = false; try { Dictionary <GGUserInfo, MessageInfo> tmpNoReadDic = new Dictionary <GGUserInfo, MessageInfo>(SingleUtils.noReadDic); foreach (KeyValuePair <GGUserInfo, MessageInfo> item in tmpNoReadDic) { GGUserInfo fromUser = item.Key; MessageInfo fromInfo = item.Value; string chatFormKey = GGUserUtils.GetChatFormKey(fromUser, SingleUtils.LOGINER); ChatForm chatFrom = null; if (SingleUtils.chatForm.ContainsKey(chatFormKey)) { chatFrom = SingleUtils.chatForm[chatFormKey] as ChatForm; chatFrom.WindowState = FormWindowState.Normal; } else { chatFrom = new ChatForm(SingleUtils.LOGINER, fromUser); chatFrom.Show(); } chatFrom.showMsgDelMethod(fromInfo); } SingleUtils.noReadDic.Clear(); } catch (Exception ex) { SoundUtils.playSound("notifyIcon1_MouseDoubleClick [ 异常:" + ex.Message + " ]", EndPointEnum.PC端); //MessageBox.Show("notifyIcon1_MouseDoubleClick [ 异常:" + ex.Message + " ]"); } }
/// <summary> /// 私聊 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void friendsList_DoubleClickSubItem(object sender, ChatListEventArgs e) { ChatListSubItem item = e.SelectSubItem; item.IsTwinkle = false; string name = item.DisplayName; GGUserInfo receiveUser = new GGUserInfo() { userNickName = name, iPEndPoint = new IPEndPoint(IPAddress.Parse("10.10.19.5"), new Random().Next(1000, 9999)) }; ChatForm f = new ChatForm(user, receiveUser, this); f.Show(); }