Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15381


Ignore:
Timestamp:
09/26/17 14:57:33 (7 years ago)
Author:
mkommend
Message:

#2837: Merged r15370 into stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.DataPreprocessing.Views

  • stable/HeuristicLab.DataPreprocessing.Views/3.4/DataPreprocessingView.cs

    r15242 r15381  
    150150      importProblemDataTypeContextMenuStrip.Show(Cursor.Position);
    151151    }
    152     private void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
    153       Import(new RegressionCSVInstanceProvider(), new RegressionImportDialog(),
    154         (dialog => ((RegressionImportDialog)dialog).ImportType));
    155     }
    156     private void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
    157       Import(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(),
    158         (dialog => ((ClassificationImportDialog)dialog).ImportType));
    159     }
    160     private void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
    161       Import(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportDialog(),
    162         (dialog => ((TimeSeriesPrognosisImportDialog)dialog).ImportType));
    163     }
    164     private void Import<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportDialog importDialog,
     152    private async void importRegressionToolStripMenuItem_Click(object sender, EventArgs e) {
     153      await ImportAsync(new RegressionCSVInstanceProvider(), new RegressionImportDialog(),
     154        dialog => ((RegressionImportDialog)dialog).ImportType);
     155    }
     156    private async void importClassificationToolStripMenuItem_Click(object sender, EventArgs e) {
     157      await ImportAsync(new ClassificationCSVInstanceProvider(), new ClassificationImportDialog(),
     158        dialog => ((ClassificationImportDialog)dialog).ImportType);
     159    }
     160    private async void importTimeSeriesToolStripMenuItem_Click(object sender, EventArgs e) {
     161      await ImportAsync(new TimeSeriesPrognosisCSVInstanceProvider(), new TimeSeriesPrognosisImportDialog(),
     162        dialog => ((TimeSeriesPrognosisImportDialog)dialog).ImportType);
     163    }
     164    private async Task ImportAsync<TProblemData, TImportType>(DataAnalysisInstanceProvider<TProblemData, TImportType> instanceProvider, DataAnalysisImportDialog importDialog,
    165165      Func<DataAnalysisImportDialog, TImportType> getImportType)
    166166      where TProblemData : class, IDataAnalysisProblemData
    167167      where TImportType : DataAnalysisImportType {
    168168      if (importDialog.ShowDialog() == DialogResult.OK) {
    169         Task.Run(() => {
     169        await Task.Run(() => {
    170170          TProblemData instance;
    171171          var mainForm = (MainForm.WindowsForms.MainForm)MainFormManager.MainForm;
Note: See TracChangeset for help on using the changeset viewer.