private void Import(IJokeImportProgressDialog importDialog)
 {
     for (int i = 0; i < 100 && !this.cancel; i++)
     {
         this.ImportJoke(i, importDialog);
     }
 }
        private void ImportJoke(int i, IJokeImportProgressDialog importDialog)
        {
            string joke = this.jokeOracle.CreateJoke();
            this.jokeImporter.ImportJoke(joke);

            this.uiSynchronizer.ExecuteAsync(() => importDialog.ShowProgress("imported " + (i + 1) + " jokes"));
        }
 private void CloseProgressDialog(IJokeImportProgressDialog importDialog)
 {
     this.uiSynchronizer.Execute(importDialog.Close);
 }