Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10217


Ignore:
Timestamp:
12/11/13 14:35:48 (9 years ago)
Author:
tsteinre
Message:
  • implemented parent hopping to find the Problem or Algorithm.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Views/3.4/ProblemDataView.cs

    r10134 r10217  
    3030using HeuristicLab.MainForm;
    3131using HeuristicLab.MainForm.WindowsForms;
     32using HeuristicLab.Optimization.Views;
    3233
    3334namespace HeuristicLab.Problems.DataAnalysis.Views {
     
    103104
    104105    private void DataPreprocessingButton_Click(object sender, EventArgs e) {
     106      // IItem i = GetAlgorithmOrProblemContent();
    105107      Type viewType = MainFormManager.GetViewTypes(this.Content.GetType(), true).FirstOrDefault(t => typeof(DataPreprocessingView).IsAssignableFrom(t));
    106108      MainFormManager.MainForm.ShowContent(Content, viewType);
    107109    }
     110
     111    private IItem GetAlgorithmOrProblemContent() {
     112      Control a = this;
     113      IItem i = null;
     114      do {
     115        a = a.Parent;
     116      } while (a != null && !(a is ProblemView));
     117
     118      if (a is ProblemView) {
     119        i = ((ProblemView)a).Content;
     120      }
     121
     122      do {
     123        a = a.Parent;
     124      } while (a != null && !(a is AlgorithmView));
     125
     126      if (a is AlgorithmView) {
     127        i = ((AlgorithmView)a).Content;
     128      }
     129
     130      return i;
     131
     132      //AlgorithmView algV = a as AlgorithmView;
     133      //var clone = (IContent)algV.Content.Clone(new Cloner());
     134      //MainFormManager.MainForm.ShowContent(clone);
     135
     136    }
    108137  }
    109138}
Note: See TracChangeset for help on using the changeset viewer.