예제 #1
0
        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
        }
예제 #2
0
        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.");
        }
예제 #3
0
 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
 }
예제 #4
0
 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.");
 }