void tcpServerHelper_ClientConn(object sender, TcpEventArgs e) { Customer customer = e.Client; ListViewItem item = new ListViewItem(new string[] { customer.GetId().ToString(), customer.Org.NickName, customer.Sender.ProgramName, customer.Version }); item.Tag = customer.GetId().ToString(); this.listView1.Items.Add(item); // this.listView1.Items.RemoveByKey }
void tcpServerHelper_ClientClose(object sender, TcpEventArgs e) { ListViewItem item; for (int i = 0; i < this.listView1.Items.Count; i++) { item = this.listView1.Items[i]; if (item.Tag.ToString() == e.Client.GetId().ToString()) { this.listView1.Items.RemoveAt(i); break; } } //throw new Exception("The method or operation is not implemented."); }
void tcpServerHelper_ClientConn(object sender, TcpEventArgs e) { Customer customer = e.Client; ListViewItem item = new ListViewItem(new string[] { customer.GetId().ToString(), customer.Org.NickName, customer.Sender.ProgramName, customer.Version }); item.Tag=customer.GetId().ToString(); this.listView1.Items.Add(item); // this.listView1.Items.RemoveByKey }
void tcpServerHelper_ClientClose(object sender, TcpEventArgs e) { ListViewItem item; for (int i = 0; i < this.listView1.Items.Count;i++ ) { item = this.listView1.Items[i]; if (item.Tag.ToString() == e.Client.GetId().ToString()) { this.listView1.Items.RemoveAt(i); break; } } //throw new Exception("The method or operation is not implemented."); }