Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking.Views/3.4/GenealogyGraphView.cs @ 10743

Last change on this file since 10743 was 10514, checked in by bburlacu, 11 years ago

#1772: Added user controls for displaying lineages and tracking building blocks with the help of the genealogy graph (work in progress).

File size: 1.9 KB
Line 
1using System.Windows.Forms;
2using HeuristicLab.Common;
3using HeuristicLab.Core.Views;
4using HeuristicLab.MainForm;
5
6namespace HeuristicLab.EvolutionTracking.Views {
7  [View("GenealogyGraphView")]
8  [Content(typeof(IGenealogyGraph), 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
19    protected override void DeregisterContentEvents() {
20      // TODO: Deregister your event handlers here
21      genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked;
22      base.DeregisterContentEvents();
23    }
24
25    protected override void RegisterContentEvents() {
26      base.RegisterContentEvents();
27      // TODO: Register your event handlers here
28      genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked;
29    }
30
31    #region Event Handlers (Content)
32    // TODO: Put event handlers of the content here
33    protected override void OnContentChanged() {
34      base.OnContentChanged();
35      if (Content != null) { genealogyGraphChart.GenealogyGraph = Content; }
36    }
37    #endregion
38
39    protected override void SetEnabledStateOfControls() {
40      base.SetEnabledStateOfControls();
41      // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
42    }
43
44    #region Event Handlers (child controls)
45    // TODO: Put event handlers of child controls here.
46    public virtual void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
47      var content = ((VisualGenealogyGraphNode)sender).Data.Content;
48      if (content != null) {
49        viewHost.Content = (IContent)content;
50      }
51    }
52    #endregion
53  }
54}
Note: See TracBrowser for help on using the repository browser.