[10302] | 1 | using System.Windows.Forms;
|
---|
| 2 | using HeuristicLab.Common;
|
---|
| 3 | using HeuristicLab.Core.Views;
|
---|
[10264] | 4 | using HeuristicLab.MainForm;
|
---|
| 5 |
|
---|
[10271] | 6 | namespace 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 | }
|
---|