Last change
on this file since 10379 was
9603,
checked in by ascheibe, 11 years ago
|
#2069 fixed object disposed exception in CodeNodeView that occurred when switching the viewhost
|
File size:
1.0 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Windows.Forms;
|
---|
3 | using HeuristicLab.Core.Views;
|
---|
4 | using HeuristicLab.MainForm;
|
---|
5 |
|
---|
6 |
|
---|
7 | namespace 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 | }
|
---|
15 |
|
---|
16 | public CodeNodeView()
|
---|
17 | : base() {
|
---|
18 | InitializeComponent();
|
---|
19 | }
|
---|
20 |
|
---|
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 | }
|
---|
31 |
|
---|
32 | private void suffixCode_Validated(object sender, EventArgs e) {
|
---|
33 | Content.Suffix = this.suffixCode.Text;
|
---|
34 | }
|
---|
35 |
|
---|
36 | private void prefixCode_Validated(object sender, EventArgs e) {
|
---|
37 | Content.Prefix = this.prefixCode.Text;
|
---|
38 | }
|
---|
39 | }
|
---|
40 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.