Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/DataAnalysisProblemDataView.cs @ 3496

Last change on this file since 3496 was 3462, checked in by gkronber, 14 years ago

Refactored symbolic expression tree encoding and problem classes for symbolic regression. #937 , #938

File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Windows.Forms;
9using HeuristicLab.Core.Views;
10using HeuristicLab.MainForm;
11
12namespace HeuristicLab.Problems.DataAnalysis.Views {
13  [View("Data-Analysis Problem View")]
14  [Content(typeof(DataAnalysisProblemData))]
15  public partial class DataAnalysisProblemDataView : NamedItemView {
16    private OpenFileDialog openFileDialog;
17    public new DataAnalysisProblemData Content {
18      get { return (DataAnalysisProblemData)base.Content; }
19      set {
20        base.Content = value;
21      }
22    }
23
24    public DataAnalysisProblemDataView() {
25      InitializeComponent();
26    }
27
28    public DataAnalysisProblemDataView(DataAnalysisProblemData content)
29      : this() {
30      Content = content;
31    }
32
33    protected override void OnContentChanged() {
34      base.OnContentChanged();
35      variableCollectionView.Content = Content.Variables.AsReadOnly();
36    }
37
38    private void importButton_Click(object sender, EventArgs e) {
39      if (openFileDialog == null) openFileDialog = new OpenFileDialog();
40
41      if (openFileDialog.ShowDialog(this) == DialogResult.OK) {
42        try {
43          Content.ImportFromFile(openFileDialog.FileName);
44        }
45        catch (Exception ex) {
46          Auxiliary.ShowErrorMessageBox(ex);
47        }
48      }
49    }
50  }
51}
Note: See TracBrowser for help on using the repository browser.