Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisSolutionView.cs @ 3997

Last change on this file since 3997 was 3915, checked in by mkommend, 14 years ago

implemented InteractiveSymbolicRegressionSolutionSimplifierView and fixed lots of minor bugs in the DataAnalysis and DataAnalysis.Views project (ticket #1010)

File size: 2.6 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21using System;
22using System.Collections.Generic;
23using System.ComponentModel;
24using System.Drawing;
25using System.Data;
26using System.Linq;
27using System.Text;
28using System.Windows.Forms;
29using HeuristicLab.MainForm;
30using HeuristicLab.MainForm.WindowsForms;
31
32namespace HeuristicLab.Problems.DataAnalysis.Views {
33  [View("Data Analysis Solution View")]
34  [Content(typeof(DataAnalysisSolution))]
35  public partial class DataAnalysisSolutionView : AsynchronousContentView {
36    public DataAnalysisSolutionView() {
37      InitializeComponent();
38    }
39
40    public new DataAnalysisSolution Content {
41      get { return (DataAnalysisSolution)base.Content; }
42      set { base.Content = value; }
43    }
44
45    protected override void OnContentChanged() {
46      base.OnContentChanged();
47      if (Content != null) {
48        modelViewHost.Content = Content.Model;
49        dataViewHost.Content = Content.ProblemData;
50      } else {
51        modelViewHost.Content = null;
52        dataViewHost.Content = null;
53      }
54    }
55
56    protected override void RegisterContentEvents() {
57      base.RegisterContentEvents();
58      Content.ModelChanged += new EventHandler(Content_ModelChanged);
59      Content.ProblemDataChanged += new EventHandler(Content_ProblemDataChanged);
60    }
61
62    protected override void DeregisterContentEvents() {
63      base.DeregisterContentEvents();
64      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
65      Content.ProblemDataChanged -= new EventHandler(Content_ProblemDataChanged);
66    }
67
68    private void Content_ModelChanged(object sender, EventArgs e) {
69      modelViewHost.Content = Content.Model;
70    }
71    private void Content_ProblemDataChanged(object sender, EventArgs e) {
72      dataViewHost.Content = Content.ProblemData;
73    }
74  }
75}
Note: See TracBrowser for help on using the repository browser.