- Timestamp:
- 07/11/17 13:02:11 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r14186 r15197 140 140 } 141 141 private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) { 142 Import(new RegressionCSVInstanceProvider(), new RegressionImport TypeDialog(),143 (dialog => ((RegressionImport TypeDialog)dialog).ImportType));142 Import(new RegressionCSVInstanceProvider(), new RegressionImportDialog(), 143 (dialog => ((RegressionImportDialog)dialog).ImportType)); 144 144 } 145 145 private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) { 146 Import(new ClassificationCSVInstanceProvider(), new ClassificationImport TypeDialog(),147 (dialog => ((ClassificationImport TypeDialog)dialog).ImportType));146 Import(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(), 147 (dialog => ((ClassificationImportDialog)dialog).ImportType)); 148 148 } 149 149 private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) { 150 Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImport TypeDialog(),151 (dialog => ((TimeSeriesPrognosisImport TypeDialog)dialog).ImportType));152 } 153 private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImport TypeDialog importTypeDialog,154 Func<DataAnalysisImport TypeDialog, TImportType> getImportType)150 Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportDialog(), 151 (dialog => ((TimeSeriesPrognosisImportDialog)dialog).ImportType)); 152 } 153 private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportDialog importDialog, 154 Func<DataAnalysisImportDialog, TImportType> getImportType) 155 155 where TProblemData : class, IDataAnalysisProblemData 156 156 where TImportType : DataAnalysisImportType { 157 if (import TypeDialog.ShowDialog() == DialogResult.OK) {157 if (importDialog.ShowDialog() == DialogResult.OK) { 158 158 Task.Run(() => { 159 159 TProblemData instance; … … 167 167 instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 168 168 169 instance = instanceProvider.ImportData(import TypeDialog.Path, getImportType(importTypeDialog), importTypeDialog.CSVFormat);169 instance = instanceProvider.ImportData(importDialog.Path, getImportType(importDialog), importDialog.CSVFormat); 170 170 } catch (IOException ex) { 171 171 MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error); … … 176 176 Content.Import(instance); 177 177 } catch (IOException ex) { 178 MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(import TypeDialog.Path), Environment.NewLine + ex.Message), "Cannot load instance");178 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"); 179 179 } finally { 180 180 mainForm.RemoveOperationProgressFromContent(activeView.Content);
Note: See TracChangeset
for help on using the changeset viewer.