[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")]
|
---|
| 8 | [Content(typeof(GenealogyGraph), 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();
|
---|
[10302] | 17 |
|
---|
| 18 | genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked;
|
---|
[10264] | 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)
|
---|
[10302] | 32 |
|
---|
[10347] | 33 | public virtual void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) {
|
---|
[10302] | 34 | var content = ((VisualGenealogyGraphNode)sender).Data.Content;
|
---|
| 35 | if (content != null) {
|
---|
| 36 | viewHost.Content = (IContent)content;
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
[10264] | 39 | // TODO: Put event handlers of the content here
|
---|
[10300] | 40 | #endregion
|
---|
| 41 |
|
---|
[10264] | 42 | protected override void OnContentChanged() {
|
---|
| 43 | base.OnContentChanged();
|
---|
[10300] | 44 | if (Content == null) {
|
---|
| 45 | } else {
|
---|
| 46 | genealogyGraphChart.GenealogyGraph = Content;
|
---|
| 47 | }
|
---|
[10264] | 48 | }
|
---|
[10300] | 49 |
|
---|
[10264] | 50 | protected override void SetEnabledStateOfControls() {
|
---|
| 51 | base.SetEnabledStateOfControls();
|
---|
[10300] | 52 | // TODO: Enable or disable controls based on whether the content is null or the view is set readonly
|
---|
[10264] | 53 | }
|
---|
| 54 |
|
---|
| 55 | #region Event Handlers (child controls)
|
---|
[10300] | 56 | // TODO: Put event handlers of child controls here.
|
---|
[10264] | 57 | #endregion
|
---|
| 58 | }
|
---|
| 59 | }
|
---|