private void ThreadProc(object o) { try { var pp = (Tuple <int, List <string> >)o; BatchRunner br = new BatchRunner(_config, _createCoreComm(), pp.Item2, pp.Item1); br.OnProgress += BrOnProgress; var results = br.Run(); this.Invoke(() => { label3.Text = "Status: Finished!"; _mostRecentResults = results; }); } catch (Exception e) { MessageBox.Show(e.ToString(), "The Whole Thing Died!"); this.Invoke(() => label3.Text = "Deaded!"); } this.Invoke(() => _thread = null); }
void ThreadProc(object o) { try { var pp = (Tuple<int, List<string>>)o; BatchRunner br = new BatchRunner(pp.Item2, pp.Item1); br.OnProgress += br_OnProgress; var results = br.Run(); this.Invoke(() => { label3.Text = "Status: Finished!"; MostRecentResults = results; }); } catch (Exception e) { MessageBox.Show(e.ToString(), "The Whole Thing Died!"); this.Invoke(() => label3.Text = "Deaded!"); } this.Invoke(() => thread = null); }
void br_OnProgress(object sender, BatchRunner.ProgressEventArgs e) { this.Invoke(() => ProgressUpdate(e.Completed, e.Total)); e.ShouldCancel = false; }