Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/27/12 13:31:44 (12 years ago)
Author:
sforsten
Message:

#1784:

  • minor bug fixes in several views
Location:
branches/ProblemInstancesRegressionAndClassification
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ProblemInstancesRegressionAndClassification

    • Property svn:ignore
      •  

        old new  
        33protoc.exe
        44ProtoGen.exe
         5bin
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4

    • Property svn:ignore set to
      bin
      HeuristicLab.Problems.Instances.Views-3.4.csproj.user
      obj
  • branches/ProblemInstancesRegressionAndClassification/HeuristicLab.Problems.Instances.Views/3.4/ProblemInstanceConsumerView.cs

    r7664 r7665  
    7373    private void problemInstanceProviderComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
    7474      if (problemInstanceProviderComboBox.SelectedIndex >= 0) {
    75         //dynamic provider = SelectedProvider;
    76         //dynamic consumer = Content;
    77         //provider.Consumer = consumer;
    7875        problemInstanceProviderViewHost.Content = SelectedProvider;
    7976        dynamic view = problemInstanceProviderViewHost.ActiveView;
    80         view.Consumer = Content;
    81         //Check if IProblemInstanceExporterView is implemented
    82         view.Exporter = Content;
     77        dynamic content = Content;
     78        view.Consumer = content;
     79        if (CheckForIProblemInstanceExporter(Content))
     80          view.Exporter = content;
    8381        //SetTooltip();
    8482      }
    8583      SetEnabledStateOfControls();
     84    }
     85
     86    private bool CheckForIProblemInstanceExporter(IProblemInstanceConsumer content) {
     87      // no check if IProblemInstanceConsumer<T> and IProblemInstanceExporter<T> have the same generic type T
     88      return Content.GetType().GetInterfaces()
     89                    .Any(x => x.IsGenericType && x.GetGenericTypeDefinition().Equals(typeof(IProblemInstanceExporter<>)));
    8690    }
    8791
Note: See TracChangeset for help on using the changeset viewer.