1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.ComponentModel;
|
---|
4 | using System.Drawing;
|
---|
5 | using System.Data;
|
---|
6 | using System.Linq;
|
---|
7 | using System.Text;
|
---|
8 | using System.Threading.Tasks;
|
---|
9 | using System.Windows.Forms;
|
---|
10 | using HeuristicLab.Core.Views;
|
---|
11 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
|
---|
12 | using HeuristicLab.MainForm;
|
---|
13 | using System.Diagnostics;
|
---|
14 | using System.IO;
|
---|
15 | using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
|
---|
16 |
|
---|
17 |
|
---|
18 | namespace HeuristicLab.Problems.Robocode
|
---|
19 | {
|
---|
20 | [View("CodeNode View")]
|
---|
21 | [Content(typeof(CodeNode), IsDefaultView = true)]
|
---|
22 | public partial class CodeNodeView : NamedItemView
|
---|
23 | {
|
---|
24 | public CodeNode Content
|
---|
25 | {
|
---|
26 | get { return (CodeNode)base.Content; }
|
---|
27 | set { base.Content = value; }
|
---|
28 | }
|
---|
29 |
|
---|
30 | public CodeNodeView() : base()
|
---|
31 | {
|
---|
32 | InitializeComponent();
|
---|
33 | //this.prefixCode.Text = Content.Prefix;
|
---|
34 | //this.suffixCode.Text = Content.Suffix;
|
---|
35 | }
|
---|
36 |
|
---|
37 | protected override void OnContentChanged()
|
---|
38 | {
|
---|
39 | base.OnContentChanged();
|
---|
40 | if (Content == null)
|
---|
41 | {
|
---|
42 | this.prefixCode.Text = "";
|
---|
43 | this.suffixCode.Text = "";
|
---|
44 | }
|
---|
45 | else
|
---|
46 | {
|
---|
47 | this.prefixCode.Text = Content.Prefix;
|
---|
48 | this.suffixCode.Text = Content.Suffix;
|
---|
49 | //Content.Prefix = this.prefixCode.Text;
|
---|
50 | //Content.Suffix = this.suffixCode.Text;
|
---|
51 | }
|
---|
52 | }
|
---|
53 |
|
---|
54 | private void prefixCode_Leave(object sender, EventArgs e)
|
---|
55 | {
|
---|
56 | Content.Prefix = this.prefixCode.Text;
|
---|
57 | }
|
---|
58 |
|
---|
59 | private void suffixCode_Leave(object sender, EventArgs e)
|
---|
60 | {
|
---|
61 | Content.Suffix = this.suffixCode.Text;
|
---|
62 | }
|
---|
63 | }
|
---|
64 | }
|
---|