Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 10884 was 10514, checked in by bburlacu, 10 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
RevLine 
[10302]1using System.Windows.Forms;
2using HeuristicLab.Common;
3using HeuristicLab.Core.Views;
[10264]4using HeuristicLab.MainForm;
5
[10271]6namespace HeuristicLab.EvolutionTracking.Views {
[10300]7  [View("GenealogyGraphView")]
[10514]8  [Content(typeof(IGenealogyGraph), IsDefaultView = false)]
[10347]9  public partial class GenealogyGraphView : ItemView {
[10300]10    public new IGenealogyGraph Content {
11      get { return (IGenealogyGraph)base.Content; }
[10264]12      set { base.Content = value; }
13    }
14
[10300]15    public GenealogyGraphView() {
[10264]16      InitializeComponent();
17    }
18
19    protected override void DeregisterContentEvents() {
20      // TODO: Deregister your event handlers here
[10501]21      genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked;
[10264]22      base.DeregisterContentEvents();
23    }
24
25    protected override void RegisterContentEvents() {
26      base.RegisterContentEvents();
27      // TODO: Register your event handlers here
[10501]28      genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked;
[10264]29    }
30
31    #region Event Handlers (Content)
32    // TODO: Put event handlers of the content here
33    protected override void OnContentChanged() {
34      base.OnContentChanged();
[10501]35      if (Content != null) { genealogyGraphChart.GenealogyGraph = Content; }
[10264]36    }
[10501]37    #endregion
[10300]38
[10264]39    protected override void SetEnabledStateOfControls() {
40      base.SetEnabledStateOfControls();
[10300]41      // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
[10264]42    }
43
44    #region Event Handlers (child controls)
[10300]45    // TODO: Put event handlers of child controls here.
[10501]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    }
[10264]52    #endregion
53  }
54}
Note: See TracBrowser for help on using the repository browser.