- Timestamp:
- 07/10/17 18:59:54 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs
r15110 r15185 151 151 } 152 152 private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) { 153 Import(new RegressionCSVInstanceProvider(), new RegressionImport TypeDialog(),154 (dialog => ((RegressionImport TypeDialog)dialog).ImportType));153 Import(new RegressionCSVInstanceProvider(), new RegressionImportDialog(), 154 (dialog => ((RegressionImportDialog)dialog).ImportType)); 155 155 } 156 156 private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) { 157 Import(new ClassificationCSVInstanceProvider(), new ClassificationImport TypeDialog(),158 (dialog => ((ClassificationImport TypeDialog)dialog).ImportType));157 Import(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(), 158 (dialog => ((ClassificationImportDialog)dialog).ImportType)); 159 159 } 160 160 private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) { 161 Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImport TypeDialog(),162 (dialog => ((TimeSeriesPrognosisImport TypeDialog)dialog).ImportType));163 } 164 private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImport TypeDialog importTypeDialog,165 Func<DataAnalysisImport TypeDialog, TImportType> getImportType)161 Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportDialog(), 162 (dialog => ((TimeSeriesPrognosisImportDialog)dialog).ImportType)); 163 } 164 private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportDialog importDialog, 165 Func<DataAnalysisImportDialog, TImportType> getImportType) 166 166 where TProblemData : class, IDataAnalysisProblemData 167 167 where TImportType : DataAnalysisImportType { 168 if (import TypeDialog.ShowDialog() == DialogResult.OK) {168 if (importDialog.ShowDialog() == DialogResult.OK) { 169 169 Task.Run(() => { 170 170 TProblemData instance; … … 178 178 instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; }; 179 179 180 instance = instanceProvider.ImportData(import TypeDialog.Path, getImportType(importTypeDialog), importTypeDialog.CSVFormat);180 instance = instanceProvider.ImportData(importDialog.Path, getImportType(importDialog), importDialog.CSVFormat); 181 181 } catch (IOException ex) { 182 182 MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error); … … 187 187 Content.Import(instance); 188 188 } catch (IOException ex) { 189 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");189 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"); 190 190 } finally { 191 191 mainForm.RemoveOperationProgressFromContent(activeView.Content);
Note: See TracChangeset
for help on using the changeset viewer.