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(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 | }
|
---|