Changeset 10000 for trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceProviderView.cs
- Timestamp:
- 09/24/13 11:49:28 (11 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceProviderView.cs
r9999 r10000 29 29 namespace HeuristicLab.Problems.Instances.DataAnalysis.Views { 30 30 [View("DataAnalysis InstanceProvider View")] 31 [Content(typeof(IProblemInstanceConsumer<IDataAnalysisProblemData>), IsDefaultView = true)] 32 [Content(typeof(IProblemInstanceConsumer<IClusteringProblemData>), IsDefaultView = true)] 33 public partial class DataAnalysisInstanceConsumerView<T> : ProblemInstanceConsumerViewGeneric<T> 31 public partial class DataAnalysisInstanceProviderView<T> : ProblemInstanceProviderViewGeneric<T> 34 32 where T : class, IDataAnalysisProblemData { 35 public new IProblemInstanceConsumer<T> Content {36 get { return (IProblemInstanceConsumer<T>)base.Content; }37 set { base.Content = value; }38 }39 33 40 public DataAnalysisInstance ConsumerView() {34 public DataAnalysisInstanceProviderView() { 41 35 InitializeComponent(); 42 36 } 43 37 44 38 protected override void importButton_Click(object sender, EventArgs e) { 45 var provider = SelectedProvideras DataAnalysisInstanceProvider<T, DataAnalysisImportType>;39 var provider = Content as DataAnalysisInstanceProvider<T, DataAnalysisImportType>; 46 40 if (provider != null) { 47 DataAnalysisImportTypeDialogimportTypeDialog = new DataAnalysisImportTypeDialog();41 var importTypeDialog = new DataAnalysisImportTypeDialog(); 48 42 if (importTypeDialog.ShowDialog() == DialogResult.OK) { 49 43 T instance = default(T); 50 44 try { 51 45 instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat); 52 } 53 catch (IOException ex) { 46 } catch (IOException ex) { 54 47 ErrorWhileParsing(ex); 55 48 return; … … 57 50 try { 58 51 GenericConsumer.Load(instance); 59 }60 catch (IOException ex) {52 instancesComboBox.SelectedIndex = -1; 53 } catch (IOException ex) { 61 54 ErrorWhileLoading(ex, importTypeDialog.Path); 62 55 } 63 } else {64 return;65 56 } 66 57 } else {
Note: See TracChangeset
for help on using the changeset viewer.