Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11281


Ignore:
Timestamp:
08/18/14 14:29:03 (10 years ago)
Author:
mkommend
Message:

#2214: Merged r11214 into stable.

Location:
stable
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • stable

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

    r11170 r11281  
    2121
    2222using System.Windows.Forms;
    23 using HeuristicLab.Core;
    24 using HeuristicLab.Core.Views;
    2523using HeuristicLab.MainForm;
    2624using HeuristicLab.Optimization;
    2725using HeuristicLab.Problems.DataAnalysis;
    2826using HeuristicLab.Problems.DataAnalysis.Views;
    29 using View = HeuristicLab.MainForm.WindowsForms.View;
    3027
    3128namespace HeuristicLab.DataPreprocessing.Views {
    3229  public class DataPreprocessorStarter : IDataPreprocessorStarter {
    3330
    34     public void Start(IDataAnalysisProblemData problemData, View currentView) {
     31    public void Start(IDataAnalysisProblemData problemData, IContentView currentView) {
    3532      IAlgorithm algorithm;
    3633      IDataAnalysisProblem problem;
    37       IItem parentItem = GetMostOuterContent(currentView, out algorithm, out problem);
     34      GetMostOuterContent(currentView as Control, out algorithm, out problem);
    3835      var context = new PreprocessingContext(problemData, algorithm, problem);
    3936      MainFormManager.MainForm.ShowContent(context);
    4037    }
    4138
    42     private IItem GetMostOuterContent(Control control, out IAlgorithm algorithm, out IDataAnalysisProblem problem) {
     39    private void GetMostOuterContent(Control control, out IAlgorithm algorithm, out IDataAnalysisProblem problem) {
    4340      algorithm = null;
    4441      problem = null;
    45       ItemView itemView = null;
    46       do {
     42
     43      while (control != null) {
     44        IContentView contentView = control as IContentView;
     45        if (contentView != null) {
     46          algorithm = contentView.Content as IAlgorithm;
     47          problem = contentView.Content as IDataAnalysisProblem;
     48        }
    4749        control = control.Parent;
    48         if (control is ItemView) {
    49           itemView = (ItemView)control;
    50           if (itemView.Content is IAlgorithm) {
    51             algorithm = (IAlgorithm)itemView.Content;
    52           }
    53           if (itemView.Content is IDataAnalysisProblem) {
    54             problem = (IDataAnalysisProblem)itemView.Content;
    55           }
    56         }
    57       } while (control != null);
    58 
    59       return itemView.Content;
     50      }
    6051    }
    6152  }
  • stable/HeuristicLab.Problems.DataAnalysis.Views

  • stable/HeuristicLab.Problems.DataAnalysis.Views/3.4/Interfaces/IDataPreprocessorStarter.cs

    r11170 r11281  
    2020#endregion
    2121
    22 using HeuristicLab.MainForm.WindowsForms;
     22using HeuristicLab.MainForm;
    2323
    2424namespace HeuristicLab.Problems.DataAnalysis.Views {
    2525  public interface IDataPreprocessorStarter {
    26     void Start(IDataAnalysisProblemData problemData, View currentView);
     26    void Start(IDataAnalysisProblemData problemData, IContentView currentView);
    2727  }
    2828}
Note: See TracChangeset for help on using the changeset viewer.