private void grouplistview_DoubleClick(object sender, MouseButtonEventArgs e) { ListView lv = sender as ListView; int index = lv.SelectedIndex; if (index < 0) { return; } if (this.groupNameList[index].ComGroupWin != null) //已经打开了 { //这句可以不要 MessageBox.Show("群会话窗口已经打开"); } else { ComunicateGroup groupWin = new ComunicateGroup(this.win, index); this.groupNameList[index].ComGroupWin = groupWin; // 更新群成员列表 // 1.发送 type == 12 的包, 返回成员列表 // 往服务器发送这个消息 Message msg = new Message(); msg.FromUserName = this.win.Ln.UserName;//"Charlie"; //msg.ToUserName = ""; // 无所谓 msg.DateLine = DateTime.Now.ToString(); msg.Type = 12; // 文字消息 msg.GroupName = this.groupNameList[index].GroupName; try { this.win.Socket.Send(msg); } catch (Exception ecp) { System.Windows.MessageBox.Show(ecp.Message, "错误"); return; } groupWin.Show(); } }
public GroupInList(string groupName) { this.groupName = groupName; this.comGroupWin = null; this.memberList = new List <string>(); }