private void _DoAnalysisBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { MethodEvaluators methodEvaluators = (MethodEvaluators)e.Argument; ExecuteOnOwningThread(analysisProgressLabel, () => { analysisProgressBar.Visible = true; analysisProgressLabel.Visible = true; analysisProgressBar.Value = 0; analysisProgressLabel.Text = "0 %"; }); MethodEvaluation cashEval = methodEvaluators.SavingCashEvaluation; MoneyBalanceOverTime cashResult = cashEval.StartEvaluation(SetProgress, 0, 33); MethodEvaluation standardEval = methodEvaluators.StandardEvaluation; MoneyBalanceOverTime standardResult = standardEval.StartEvaluation(SetProgress, 34, 66); MethodEvaluation experimentalEvaluation = methodEvaluators.ExperimentalEvaluation; MoneyBalanceOverTime experimentalResult = experimentalEvaluation.StartEvaluation(SetProgress, 67, 100); var results = new EvaluatorsResults(cashResult, standardResult, experimentalResult); e.Result = results; }
private void _DoAnalysisBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ExecuteOnOwningThread(analysisProgressLabel, () => { this.ChartTabControl.Visible = true; analysisProgressBar.Visible = false; analysisProgressLabel.Visible = false; EvaluatorsResults results = (EvaluatorsResults)e.Result; MoneyBalanceOverTime cashResults = results.CashResult; MoneyBalanceOverTime standardResults = results.StandardResult; MoneyBalanceOverTime experimentalResults = results.ExperimentalResult; ChartResults(cashResults, standardResults, experimentalResults); }); }