- Timestamp:
- 07/04/19 14:45:47 (5 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views
- Property svn:mergeinfo changed
/trunk/HeuristicLab.DataPreprocessing.Views merged: 16356,16389,16430 /trunk/sources/HeuristicLab.DataPreprocessing.Views merged: 15581,15583,15589
- Property svn:mergeinfo changed
-
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r15584 r17062 165 165 await Task.Run(() => { 166 166 TProblemData instance; 167 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;168 167 // lock active view and show progress bar 169 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;170 168 171 169 try { 172 var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance."); 173 170 var progress = Progress.Show(Content, "Loading problem instance."); 174 171 instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 175 172 … … 177 174 } catch (IOException ex) { 178 175 MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error); 179 mainForm.RemoveOperationProgressFromContent(activeView.Content);176 Progress.Hide(Content); 180 177 return; 181 178 } … … 185 182 MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance"); 186 183 } finally { 187 mainForm.RemoveOperationProgressFromContent(activeView.Content);184 Progress.Hide(Content); 188 185 } 189 186 }); … … 222 219 var storable = itemCreator() as IStorableContent; 223 220 if (storable != null) { 224 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;225 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;226 221 try { 227 mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");222 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 228 223 ContentManager.Save(storable, saveFileDialog.FileName, compressed); 229 224 } finally { 230 mainForm.RemoveOperationProgressFromContent(activeView.Content);225 Progress.Hide(Content); 231 226 } 232 227 } … … 244 239 if (saveFileDialog.ShowDialog() == DialogResult.OK) { 245 240 Task.Run(() => { 246 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;247 var activeView = (IContentView)MainFormManager.MainForm.ActiveView;248 241 try { 249 242 var problemData = Content.CreateNewProblemData(); 250 mainForm.AddOperationProgressToContent(activeView.Content, "Exporting data.");243 Progress.Show(Content, "Exporting data.", ProgressMode.Indeterminate); 251 244 if (problemData is TimeSeriesPrognosisProblemData) 252 245 Export(new TimeSeriesPrognosisCSVInstanceProvider(), problemData, saveFileDialog.FileName); … … 256 249 Export(new ClassificationCSVInstanceProvider(), problemData, saveFileDialog.FileName); 257 250 } finally { 258 mainForm.RemoveOperationProgressFromContent(activeView.Content);251 Progress.Hide(Content); 259 252 } 260 253 });
Note: See TracChangeset
for help on using the changeset viewer.