Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/17 18:59:54 (7 years ago)
Author:
gkronber
Message:

#2801: renamed classes for import dialogs

File:
1 edited

Legend:

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

    r15110 r15185  
    151151    }
    152152    private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
    153       Import(new RegressionCSVInstanceProvider(), new RegressionImportTypeDialog(),
    154         (dialog => ((RegressionImportTypeDialog)dialog).ImportType));
     153      Import(new RegressionCSVInstanceProvider(), new RegressionImportDialog(),
     154        (dialog => ((RegressionImportDialog)dialog).ImportType));
    155155    }
    156156    private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
    157       Import(new ClassificationCSVInstanceProvider(), new ClassificationImportTypeDialog(),
    158         (dialog => ((ClassificationImportTypeDialog)dialog).ImportType));
     157      Import(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(),
     158        (dialog => ((ClassificationImportDialog)dialog).ImportType));
    159159    }
    160160    private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
    161       Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportTypeDialog(),
    162         (dialog => ((TimeSeriesPrognosisImportTypeDialog)dialog).ImportType));
    163     }
    164     private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportTypeDialog importTypeDialog,
    165       Func<DataAnalysisImportTypeDialog, 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)
    166166      where TProblemData : class, IDataAnalysisProblemData
    167167      where TImportType : DataAnalysisImportType {
    168       if (importTypeDialog.ShowDialog() == DialogResult.OK) {
     168      if (importDialog.ShowDialog() == DialogResult.OK) {
    169169        Task.Run(() => {
    170170          TProblemData instance;
     
    178178            instanceProvider.ProgressChanged += (o, args) => { progress.ProgressValue = args.ProgressPercentage / 100.0; };
    179179
    180             instance = instanceProvider.ImportData(importTypeDialog.Path, getImportType(importTypeDialog), importTypeDialog.CSVFormat);
     180            instance = instanceProvider.ImportData(importDialog.Path, getImportType(importDialog), importDialog.CSVFormat);
    181181          } catch (IOException ex) {
    182182            MessageBox.Show(string.Format("There was an error parsing the file: {0}", Environment.NewLine + ex.Message), "Error while parsing", MessageBoxButtons.OK, MessageBoxIcon.Error);
     
    187187            Content.Import(instance);
    188188          } catch (IOException ex) {
    189             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");
     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");
    190190          } finally {
    191191            mainForm.RemoveOperationProgressFromContent(activeView.Content);
Note: See TracChangeset for help on using the changeset viewer.