protected override void importButton_Click(object sender, EventArgs e) { var provider = Content as DataAnalysisInstanceProvider <T, DataAnalysisImportType>; if (provider != null) { var importTypeDialog = new DataAnalysisImportTypeDialog(); if (importTypeDialog.ShowDialog() == DialogResult.OK) { T instance = default(T); try { instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); } catch (IOException ex) { ErrorWhileParsing(ex); return; } try { GenericConsumer.Load(instance); instancesComboBox.SelectedIndex = -1; } catch (IOException ex) { ErrorWhileLoading(ex, importTypeDialog.Path); } } } else { base.importButton_Click(sender, e); } }
protected override void importButton_Click(object sender, EventArgs e) { var importTypeDialog = new DataAnalysisImportTypeDialog(); if (importTypeDialog.ShowDialog() == DialogResult.OK) { IClusteringProblemData instance = null; try { instance = Content.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); } catch (IOException ex) { ErrorWhileParsing(ex); return; } try { GenericConsumer.Load(instance); instancesComboBox.SelectedIndex = -1; } catch (IOException ex) { ErrorWhileLoading(ex, importTypeDialog.Path); } } }