title: Wait until my BackgroundWorker finish in order to open new BackgroundWorker
body: <p>In my application i am checking my files by open Wireshark process before add to my Listbox.
  this is Add Directory click event who take root folder and checking all this files inside this folder and sub folders:</p>
  
  <pre><code>private void btnAddDir_Click(object sender, EventArgs e)
  {
      try
      {
          if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
          {
              ThreadStart threadStart = delegate
              {
                  foreach (string file in SafeFileEnumerator.EnumerateFiles(folderBrowserDialog1.SelectedPath, "*.*", SearchOption.AllDirectories))
                  {
                      Interlocked.Increment(ref numWorkers);
                      StartBackgroundFileChecker(file);
                  }
              };
  
              Thread thread = new Thread(threadStart);
              thread.IsBackground = true;
              thread.Start();
          }
      }
      catch (Exception)
      { }
  }
  
  private void StartBackgroundFileChecker(string file)
  {
      ListboxFile listboxFile = new ListboxFile();
      listboxFile.OnFileAddEvent += listboxFile_OnFileAddEvent;
      BackgroundWorker backgroundWorker = new BackgroundWorker();
      backgroundWorker.WorkerReportsProgress = true;
      backgroundWorker.DoWork +=
      (s3, e3) =&gt;
      {
          //check my file
      };
  
      backgroundWorker.RunWorkerCompleted += backgroundWorker_RunWorkerCompleted;
      backgroundWorker.RunWorkerAsync();
  }
  
  void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
  {
      if (Interlocked.Decrement(ref numWorkers) == 0)
      {
          //update my UI
      }
  }
  </code></pre>
  
  <p>When i am checking this file i am open <code>Wireshark</code> process so if i choose folder with many files, many <code>Wireshark</code> processes opned and this take a lot on memory, 
  how can i wait until my BackgroundWorker finish and only then open new one ?</p>