Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/24/13 11:49:28 (11 years ago)
Author:
jkarder
Message:

#2110: refactored ProblemInstanceProviderViews

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Instances.DataAnalysis.Views/3.3/DataAnalysisInstanceProviderView.cs

    r9999 r10000  
    2929namespace HeuristicLab.Problems.Instances.DataAnalysis.Views {
    3030  [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>
    3432    where T : class, IDataAnalysisProblemData {
    35     public new IProblemInstanceConsumer<T> Content {
    36       get { return (IProblemInstanceConsumer<T>)base.Content; }
    37       set { base.Content = value; }
    38     }
    3933
    40     public DataAnalysisInstanceConsumerView() {
     34    public DataAnalysisInstanceProviderView() {
    4135      InitializeComponent();
    4236    }
    4337
    4438    protected override void importButton_Click(object sender, EventArgs e) {
    45       var provider = SelectedProvider as DataAnalysisInstanceProvider<T, DataAnalysisImportType>;
     39      var provider = Content as DataAnalysisInstanceProvider<T, DataAnalysisImportType>;
    4640      if (provider != null) {
    47         DataAnalysisImportTypeDialog importTypeDialog = new DataAnalysisImportTypeDialog();
     41        var importTypeDialog = new DataAnalysisImportTypeDialog();
    4842        if (importTypeDialog.ShowDialog() == DialogResult.OK) {
    4943          T instance = default(T);
    5044          try {
    5145            instance = provider.ImportData(importTypeDialog.Path, importTypeDialog.ImportType, importTypeDialog.CSVFormat);
    52           }
    53           catch (IOException ex) {
     46          } catch (IOException ex) {
    5447            ErrorWhileParsing(ex);
    5548            return;
     
    5750          try {
    5851            GenericConsumer.Load(instance);
    59           }
    60           catch (IOException ex) {
     52            instancesComboBox.SelectedIndex = -1;
     53          } catch (IOException ex) {
    6154            ErrorWhileLoading(ex, importTypeDialog.Path);
    6255          }
    63         } else {
    64           return;
    6556        }
    6657      } else {
Note: See TracChangeset for help on using the changeset viewer.