1 | using System.Windows.Forms;
|
---|
2 | using HeuristicLab.Common;
|
---|
3 | using HeuristicLab.Core.Views;
|
---|
4 | using HeuristicLab.MainForm;
|
---|
5 |
|
---|
6 | namespace HeuristicLab.EvolutionTracking.Views {
|
---|
7 | [View("GenealogyGraphView")]
|
---|
8 | [Content(typeof(GenealogyGraph), IsDefaultView = false)]
|
---|
9 | public partial class GenealogyGraphView : ItemView {
|
---|
10 | public new IGenealogyGraph Content {
|
---|
11 | get { return (IGenealogyGraph)base.Content; }
|
---|
12 | set { base.Content = value; }
|
---|
13 | }
|
---|
14 |
|
---|
15 | public GenealogyGraphView() {
|
---|
16 | InitializeComponent();
|
---|
17 |
|
---|
18 | genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked;
|
---|
19 | }
|
---|
20 |
|
---|
21 | protected override void DeregisterContentEvents() {
|
---|
22 | // TODO: Deregister your event handlers here
|
---|
23 | base.DeregisterContentEvents();
|
---|
24 | }
|
---|
25 |
|
---|
26 | protected override void RegisterContentEvents() {
|
---|
27 | base.RegisterContentEvents();
|
---|
28 | // TODO: Register your event handlers here
|
---|
29 | }
|
---|
30 |
|
---|
31 | #region Event Handlers (Content)
|
---|
32 |
|
---|
33 | public virtual void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
|
---|
34 | var content = ((VisualGenealogyGraphNode)sender).Data.Content;
|
---|
35 | if (content != null) {
|
---|
36 | viewHost.Content = (IContent)content;
|
---|
37 | }
|
---|
38 | }
|
---|
39 | // TODO: Put event handlers of the content here
|
---|
40 | #endregion
|
---|
41 |
|
---|
42 | protected override void OnContentChanged() {
|
---|
43 | base.OnContentChanged();
|
---|
44 | if (Content == null) {
|
---|
45 | } else {
|
---|
46 | genealogyGraphChart.GenealogyGraph = Content;
|
---|
47 | }
|
---|
48 | }
|
---|
49 |
|
---|
50 | protected override void SetEnabledStateOfControls() {
|
---|
51 | base.SetEnabledStateOfControls();
|
---|
52 | // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
|
---|
53 | }
|
---|
54 |
|
---|
55 | #region Event Handlers (child controls)
|
---|
56 | // TODO: Put event handlers of child controls here.
|
---|
57 | #endregion
|
---|
58 | }
|
---|
59 | }
|
---|