public void Populate()
 {
     if (activeClientsLstView.InvokeRequired)
     {
         PopulateCallback d = new PopulateCallback(Populate);
         this.Invoke(d);
     }
     else
     {
         List <UserClient> dat = proctor.GetConnection().GetClients();
         activeClientsLstView.Items.Clear();
         foreach (UserClient client in dat)
         {
             string[] subItems = new string[5];
             subItems[0] = client.GetName();
             subItems[1] = client.GetID().ToString();
             ListViewItem item = new ListViewItem(subItems);
             item.Name             = client.GetName();
             item.SubItems[1].Name = "UserID";
             item.SubItems[2].Name = "PredictedUser";
             item.SubItems[3].Name = "PredictedUserID";
             item.SubItems[4].Name = "PercentSure";
             activeClientsLstView.Items.Add(item);
         }
     }
 }
Ejemplo n.º 2
0
 private void CrossThreadPopulateSourceFileList()
 {
     if (this.SourceFileListBox.InvokeRequired)
     {
         PopulateCallback pcb = new PopulateCallback(CrossThreadPopulateSourceFileList);
         this.Invoke(pcb);
     }
     else
     {
         PopulateSourceFileList();
     }
 }
 private void CrossThreadPopulateSourceFileList()
 {
     if( this.SourceFileListBox.InvokeRequired )
     {
         PopulateCallback pcb = new PopulateCallback( CrossThreadPopulateSourceFileList );
         this.Invoke( pcb );
     }
     else
     {
         PopulateSourceFileList();
     }
 }