Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Robocode/HeuristicLab.Problems.Robocode/Symbols/CodeNodeView.cs @ 12394

Last change on this file since 12394 was 9603, checked in by ascheibe, 12 years ago

#2069 fixed object disposed exception in CodeNodeView that occurred when switching the viewhost

File size: 1.0 KB
RevLine 
[9565]1using System;
2using System.Windows.Forms;
3using HeuristicLab.Core.Views;
4using HeuristicLab.MainForm;
5
6
[9601]7namespace HeuristicLab.Problems.Robocode {
8  [View("CodeNode View")]
9  [Content(typeof(CodeNode), IsDefaultView = true)]
10  public partial class CodeNodeView : NamedItemView {
11    public new CodeNode Content {
12      get { return (CodeNode)base.Content; }
13      set { base.Content = value; }
14    }
[9565]15
[9601]16    public CodeNodeView()
17      : base() {
18      InitializeComponent();
19    }
[9565]20
[9601]21    protected override void OnContentChanged() {
22      base.OnContentChanged();
23      if (Content == null) {
24        this.prefixCode.Text = "";
25        this.suffixCode.Text = "";
26      } else {
27        this.prefixCode.Text = Content.Prefix;
28        this.suffixCode.Text = Content.Suffix;
29      }
30    }
[9565]31
[9603]32    private void suffixCode_Validated(object sender, EventArgs e) {
33      Content.Suffix = this.suffixCode.Text;
[9601]34    }
[9565]35
[9603]36    private void prefixCode_Validated(object sender, EventArgs e) {
37      Content.Prefix = this.prefixCode.Text;
[9565]38    }
[9601]39  }
[9565]40}
Note: See TracBrowser for help on using the repository browser.