Exemple #1
0
        private void m_RefreshList(CkernelGateway in_krnGateway)
        {
            int nItem = 0;

            itemsToRemove.Clear();
            while (nItem < Items.Count)
            {
                ListViewItem Item = Items[nItem];
                if (Item == null)
                {
                    break;
                }
                InterfaceClient clientant = (InterfaceClient)Item.Tag;
                InterfaceClient client    = in_krnGateway.GetUploadClient(clientant.ID, clientant.Port, clientant.ServerIP, clientant.UserHash);
                if (client == null)
                {
                    itemsToRemove.Add(Item);                              //Items.RemoveAt(nItem);
                }
                else
                {
                    ClientToItem(client, Item);
                }
                nItem++;
            }
            foreach (ListViewItem Item in itemsToRemove)
            {
                this.Items.Remove(Item);
            }
        }
 private void m_RefreshList(CkernelGateway in_krnGateway)
 {
     int nItem=0;
     itemsToRemove.Clear();
     while (nItem<Items.Count)
     {
         ListViewItem Item=Items[nItem];
         if (Item==null) break;
         InterfaceClient clientant=(InterfaceClient)Item.Tag;
         InterfaceClient client=in_krnGateway.GetUploadClient(clientant.ID,clientant.Port,clientant.ServerIP,clientant.UserHash);
         if (client==null) itemsToRemove.Add(Item);//Items.RemoveAt(nItem);
         else ClientToItem(client,Item);
         nItem++;
     }
     foreach (ListViewItem Item in itemsToRemove)
     {
         this.Items.Remove(Item);
     }
 }