Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/RegressionEnsembleSolutionView.cs @ 6612

Last change on this file since 6612 was 6612, checked in by mkommend, 13 years ago

#1592: Implemented view for regression solutions contained in a RegressionEnsembleSolution.

File size: 2.7 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2011 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
21
22using System;
23using System.Windows.Forms;
24using HeuristicLab.MainForm;
25using HeuristicLab.MainForm.WindowsForms;
26
27namespace HeuristicLab.Problems.DataAnalysis.Views {
28  [View("RegressionEnsembleSolution View")]
29  [Content(typeof(RegressionEnsembleSolution), true)]
30  public partial class RegressionEnsembleSolutionView : RegressionSolutionView {
31    public RegressionEnsembleSolutionView() {
32      InitializeComponent();
33      AddViewListViewItem(typeof(RegressionEnsembleSolutionModelView), HeuristicLab.Common.Resources.VSImageLibrary.Function);
34    }
35
36    public new RegressionEnsembleSolution Content {
37      get { return (RegressionEnsembleSolution)base.Content; }
38      set { base.Content = value; }
39    }
40
41    protected override void itemsListView_DoubleClick(object sender, EventArgs e) {
42      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(RegressionEnsembleSolutionModelView)) {
43        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
44        var view = MainFormManager.MainForm.ShowContent(Content.RegressionSolutions, viewType);
45        view.ReadOnly = false;
46        view.Locked = Locked;
47      } else
48        base.itemsListView_DoubleClick(sender, e);
49    }
50
51    protected override void itemsListView_SelectedIndexChanged(object sender, EventArgs e) {
52      if (Content != null && itemsListView.SelectedItems.Count == 1 && itemsListView.SelectedItems[0].Tag == typeof(RegressionEnsembleSolutionModelView)) {
53        detailsGroupBox.Enabled = true;
54        Type viewType = (Type)itemsListView.SelectedItems[0].Tag;
55        viewHost.ViewType = viewType;
56        viewHost.Content = Content.RegressionSolutions;
57        viewHost.ReadOnly = false;
58        viewHost.Locked = Locked;
59      } else
60        base.itemsListView_SelectedIndexChanged(sender, e);
61    }
62  }
63}
Note: See TracBrowser for help on using the repository browser.