using System; using System.Windows.Forms; using HeuristicLab.Core.Views; using HeuristicLab.MainForm; namespace HeuristicLab.Problems.Robocode { [View("CodeNode View")] [Content(typeof(CodeNode), IsDefaultView = true)] public partial class CodeNodeView : NamedItemView { public new CodeNode Content { get { return (CodeNode)base.Content; } set { base.Content = value; } } public CodeNodeView() : base() { InitializeComponent(); } protected override void OnContentChanged() { base.OnContentChanged(); if (Content == null) { this.prefixCode.Text = ""; this.suffixCode.Text = ""; } else { this.prefixCode.Text = Content.Prefix; this.suffixCode.Text = Content.Suffix; } } private void suffixCode_Validated(object sender, EventArgs e) { Content.Suffix = this.suffixCode.Text; } private void prefixCode_Validated(object sender, EventArgs e) { Content.Prefix = this.prefixCode.Text; } } }