Changeset 9904 for branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/ChartAnalysisView.cs
- Timestamp:
- 08/23/13 10:33:11 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/StatisticalTesting/HeuristicLab.Analysis.Statistics/3.3/ChartAnalysisView.cs
r9749 r9904 48 48 49 49 private List<IRun> runs; 50 private Progress progress; 51 private ProgressView progressView; 50 private IProgress progress; 52 51 private bool valuesAdded = false; 53 52 54 53 public ChartAnalysisView() { 55 54 InitializeComponent(); 56 progress = new Progress() {57 CanBeCanceled = false,58 ProgressState = ProgressState.Finished59 };60 progressView = new ProgressView(this, progress);61 55 62 56 stringConvertibleMatrixView.DataGridView.RowHeaderMouseDoubleClick += new DataGridViewCellMouseEventHandler(DataGridView_RowHeaderMouseDoubleClick); … … 78 72 components.Dispose(); 79 73 } 80 if (disposing) 81 progressView.Dispose(); 74 82 75 base.Dispose(disposing); 83 76 } … … 153 146 154 147 private void addLineToChart_Click(object sender, EventArgs e) { 155 progress.Status = "Adding fitted lines to charts..."; 156 progress.ProgressState = ProgressState.Started; 157 progress.ProgressValue = 0.0; 148 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Adding fitted lines to charts..."); 158 149 159 150 var task = System.Threading.Tasks.Task.Factory.StartNew(AddLineToChart); 160 151 161 152 task.ContinueWith((t) => { 162 progress.Finish();153 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 163 154 ErrorHandling.ShowErrorDialog("An error occured while adding lines to charts. ", t.Exception); 164 155 }, TaskContinuationOptions.OnlyOnFaulted); 165 156 166 157 task.ContinueWith((t) => { 167 progress.Finish();158 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 168 159 }, TaskContinuationOptions.OnlyOnRanToCompletion); 169 160 } … … 235 226 236 227 private void RebuildDataTableAsync() { 237 progress.Status = "Calculating values..."; 238 progress.ProgressState = ProgressState.Started; 239 progress.ProgressValue = 0.0; 240 241 var task = System.Threading.Tasks.Task.Factory.StartNew(RebuildDataTable); 228 progress = MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().AddOperationProgressToView(this, "Calculating values..."); 229 230 var task = Task.Factory.StartNew(RebuildDataTable); 242 231 243 232 task.ContinueWith((t) => { 244 progress.Finish();233 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 245 234 ErrorHandling.ShowErrorDialog("An error occured while calculating values. ", t.Exception); 246 235 }, TaskContinuationOptions.OnlyOnFaulted); 247 236 248 237 task.ContinueWith((t) => { 249 progress.Finish();238 MainFormManager.GetMainForm<HeuristicLab.MainForm.WindowsForms.MainForm>().RemoveOperationProgressFromView(this); 250 239 }, TaskContinuationOptions.OnlyOnRanToCompletion); 251 240 } … … 307 296 308 297 i++; 298 progress.ProgressValue = runs.Count / i; 309 299 } 310 300 stringConvertibleMatrixView.Content = dt;
Note: See TracChangeset
for help on using the changeset viewer.