using System.Windows.Forms; using HeuristicLab.Common; using HeuristicLab.Core.Views; using HeuristicLab.MainForm; namespace HeuristicLab.EvolutionTracking.Views { [View("GenealogyGraphView")] [Content(typeof(IGenealogyGraph), IsDefaultView = false)] public partial class GenealogyGraphView : ItemView { public new IGenealogyGraph Content { get { return (IGenealogyGraph)base.Content; } set { base.Content = value; } } public GenealogyGraphView() { InitializeComponent(); } protected override void DeregisterContentEvents() { // TODO: Deregister your event handlers here genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked; base.DeregisterContentEvents(); } protected override void RegisterContentEvents() { base.RegisterContentEvents(); // TODO: Register your event handlers here genealogyGraphChart.GenealogyGraphNodeClicked += graphChart_GenealogyGraphNodeClicked; } #region Event Handlers (Content) // TODO: Put event handlers of the content here protected override void OnContentChanged() { base.OnContentChanged(); if (Content != null) { genealogyGraphChart.GenealogyGraph = Content; } } #endregion protected override void SetEnabledStateOfControls() { base.SetEnabledStateOfControls(); // TODO: Enable or disable controls based on whether the content is null or the view is set readonly } #region Event Handlers (child controls) // TODO: Put event handlers of child controls here. public virtual void graphChart_GenealogyGraphNodeClicked(object sender, MouseEventArgs args) { var content = ((VisualGenealogyGraphNode)sender).Data.Content; if (content != null) { viewHost.Content = (IContent)content; } } #endregion } }