private async void ResetProgressBar()
 {
     ProgressBar1.Visible = false;
     ProgressBar1.Value   = 0;
     ProgressBar1.Update();
     UseWaitCursor = false;
 }
 public void UpdateProgressBar(string currentDisconnectintClientName)
 {
     //if (sections < _InternalClientList.Count - 1) {
     //    ++sections;
     //}
     //if (sections < TotalConnectedClients) {
     //    ++sections;
     //}
     if (InvokeRequired)
     {
         Invoke(new Action((delegate
         {
             ++ProgressBar1.Value;
         })));
         Invoke(new Action((delegate
         {
             LblDisconnecting.Text = @"Disconnecting " + currentDisconnectintClientName + @" " + ProgressBar1.Value + @" of " + ProgressBar1.Maximum;
         })));
         Invoke(new Action((delegate
         {
             ProgressBar1.Update();
         })));
     }
     else
     {
         ++ProgressBar1.Value;
     }
     //Thread.Sleep(250);
     //if (ProgressBar1.Value == ProgressBar1.Maximum) {
     //    Invoke(new Action(Close));
     //}
 }
 private void T2_ProgressChanged(object sender, ProgressChangedEventArgs e)
 {
     ProgressBar1.Increment(10);
     ProgressBar1.Update();
 }