Changeset 14029 for branches/crossvalidation-2434/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceProviderView.cs
- Timestamp:
- 07/08/16 14:40:02 (8 years ago)
- Location:
- branches/crossvalidation-2434
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crossvalidation-2434
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.Instances.DataAnalysis.Views
- Property svn:mergeinfo changed
/stable/HeuristicLab.Problems.Instances.DataAnalysis.Views merged: 13316 /trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views (added) merged: 13321,13397,13413-13415,13441,13584
- Property svn:mergeinfo changed
-
branches/crossvalidation-2434/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/RegressionInstanceProviderView.cs
r12012 r14029 22 22 using System; 23 23 using System.IO; 24 using System.Threading.Tasks; 24 25 using System.Windows.Forms; 25 26 using HeuristicLab.MainForm; … … 44 45 if (importTypeDialog.ShowDialog() == DialogResult.OK) { 45 46 IRegressionProblemData instance = null; 46 try { 47 instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); 48 } catch (IOException ex) { 49 ErrorWhileParsing(ex); 50 return; 51 } 52 try { 53 GenericConsumer.Load(instance); 54 instancesComboBox.SelectedIndex = -1; 55 } catch (IOException ex) { 56 ErrorWhileLoading(ex, importTypeDialog.Path); 57 } 47 48 Task.Factory.StartNew(() => { 49 var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm; 50 // lock active view and show progress bar 51 IContentView activeView = (IContentView)MainFormManager.MainForm.ActiveView; 52 53 try { 54 var progress = mainForm.AddOperationProgressToContent(activeView.Content, "Loading problem instance."); 55 56 Content.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 57 58 instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); 59 } catch (IOException ex) { 60 ErrorWhileParsing(ex); 61 mainForm.RemoveOperationProgressFromContent(activeView.Content); 62 return; 63 } 64 try { 65 GenericConsumer.Load(instance); 66 } catch (IOException ex) { 67 ErrorWhileLoading(ex, importTypeDialog.Path); 68 } finally { 69 Invoke((Action)(() => instancesComboBox.SelectedIndex = -1)); 70 mainForm.RemoveOperationProgressFromContent(activeView.Content); 71 } 72 }); 58 73 } 59 74 }
Note: See TracChangeset
for help on using the changeset viewer.