Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/11/17 13:02:11 (7 years ago)
Author:
gkronber
Message:

#2081: merged r15184 and r15185 from trunk to stable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r14186 r15197  
    140140    }
    141141    private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
    142       Import(new RegressionCSVInstanceProvider(), new RegressionImportTypeDialog(),
    143         (dialog => ((RegressionImportTypeDialog)dialog).ImportType));
     142      Import(new RegressionCSVInstanceProvider(), new RegressionImportDialog(),
     143        (dialog => ((RegressionImportDialog)dialog).ImportType));
    144144    }
    145145    private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
    146       Import(new ClassificationCSVInstanceProvider(), new ClassificationImportTypeDialog(),
    147         (dialog => ((ClassificationImportTypeDialog)dialog).ImportType));
     146      Import(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(),
     147        (dialog => ((ClassificationImportDialog)dialog).ImportType));
    148148    }
    149149    private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
    150       Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportTypeDialog(),
    151         (dialog => ((TimeSeriesPrognosisImportTypeDialog)dialog).ImportType));
    152     }
    153     private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportTypeDialog importTypeDialog,
    154       Func<DataAnalysisImportTypeDialog, 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)
    155155      where TProblemData : class, IDataAnalysisProblemData
    156156      where TImportType : DataAnalysisImportType {
    157       if (importTypeDialog.ShowDialog() == DialogResult.OK) {
     157      if (importDialog.ShowDialog() == DialogResult.OK) {
    158158        Task.Run(() => {
    159159          TProblemData instance;
     
    167167            instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
    168168
    169             instance = instanceProvider.ImportData(importTypeDialog.Path, getImportType(importTypeDialog), importTypeDialog.CSVFormat);
     169            instance = instanceProvider.ImportData(importDialog.Path, getImportType(importDialog), importDialog.CSVFormat);
    170170          } catch (IOException ex) {
    171171            MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
     
    176176            Content.Import(instance);
    177177          } catch (IOException ex) {
    178             MessageBox.Show(string.Format("This problem does not support loading the instance {0}: {1}", Path.GetFileName(importTypeDialog.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");
    179179          } finally {
    180180            mainForm.RemoveOperationProgressFromContent(activeView.Content);
Note: See TracChangeset for help on using the changeset viewer.