Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6729


Ignore:
Timestamp:
09/09/11 12:12:42 (13 years ago)
Author:
gkronber
Message:

#1594 #1637 added view caching to NamedDataAnalysisSolutionView

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views/3.4/SymbolicDiscriminantFunctionClassificationSolutionView.cs

    r5975 r6729  
    2626
    2727namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Classification.Views {
    28   [Content(typeof(SymbolicDiscriminantFunctionClassificationSolution), true)]
     28  [Content(typeof(SymbolicDiscriminantFunctionClassificationSolution), false)]
    2929  [View("SymbolicDiscriminantFunctionClassificationSolution View")]
    3030  public partial class SymbolicDiscriminantFunctionClassificationSolutionView : DiscriminantFunctionClassificationSolutionView {
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Classification/DiscriminantFunctionClassificationSolutionThresholdView.cs

    r6642 r6729  
    3232namespace HeuristicLab.Problems.DataAnalysis.Views {
    3333  [View("Classification Threshold")]
    34   [Content(typeof(IDiscriminantFunctionClassificationSolution), true)]
     34  [Content(typeof(IDiscriminantFunctionClassificationSolution), false)]
    3535  public sealed partial class DiscriminantFunctionClassificationSolutionThresholdView : DataAnalysisSolutionEvaluationView {
    3636    private const double TrainingAxisValue = 0.0;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/NamedDataAnalysisSolutionView.cs

    r6652 r6729  
    3030  [Content(typeof(DataAnalysisSolution), true)]
    3131  public partial class NamedDataAnalysisSolutionView : NamedItemView {
     32    private Type contentType;
     33    private DataAnalysisSolutionView view;
     34
    3235    public NamedDataAnalysisSolutionView() {
    3336      InitializeComponent();
     
    4144    protected override void OnContentChanged() {
    4245      base.OnContentChanged();
    43       panel.Controls.Clear();
    4446
    45       if (Content != null) {
     47      if (Content == null) {
     48        panel.Controls.Clear();
     49      } else if (Content.GetType() == contentType && view != null) {
     50        view.Content = Content;
     51      } else {
     52        view = null;
     53        contentType = Content.GetType();
     54        panel.Controls.Clear();
    4655        var viewType = MainFormManager.GetViewTypes(Content.GetType(), true).Where(t => typeof(DataAnalysisSolutionView).IsAssignableFrom(t)).FirstOrDefault();
    4756        if (viewType != null) {
    48           var view = (DataAnalysisSolutionView)Activator.CreateInstance(viewType);
     57          view = (DataAnalysisSolutionView)Activator.CreateInstance(viewType);
    4958          view.Dock = DockStyle.Fill;
    5059          view.Content = Content;
Note: See TracChangeset for help on using the changeset viewer.