public void ShowAndDoWork(Action <IProgress, DoWorkEventArgs> work) { Progress.ProgressIndicator = ProgressBar; Progress.AddStatusProgress(StatusLabel); ProgressString = new StringBuilderProgress(); Progress.AddMessageProgress(ProgressString); //Progress.AddMessageProgress(_messageLabelProgress); _backgroundWorker.RunWorkerCompleted += (sender, e) => Close(); _backgroundWorker.WorkerReportsProgress = true; _backgroundWorker.WorkerSupportsCancellation = true; _backgroundWorker.ProgressChanged += new ProgressChangedEventHandler(_backgroundWorker_ProgressChanged); _backgroundWorker.DoWork += (sender, arg) => work(Progress, arg); ShowDialog(); }
public void ShowAndDoWork(Action <IProgress> work) { _work = work; Progress.ProgressIndicator = ProgressBar; Progress.AddStatusProgress(_status); Progress.AddMessageProgress(_messageLabelProgress); Progress.Add(new ApplicationDoEventsProgress()); //this will keep our UI alive var stringProgress = new StringBuilderProgress(); Progress.Add(stringProgress); Application.Idle += StartWorking; ShowDialog(); if (Progress.ErrorEncountered) { Palaso.Reporting.ErrorReport.NotifyUserOfProblem("There was a problem performing that operation.\r\n\r\n" + stringProgress.Text); } }
public void AddStatusProgress(IProgress p) { _progress.AddStatusProgress(p); }
public void AddStatusDisplay(IProgress progress) { _progress.AddStatusProgress(progress); }