Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 9598 was 9565, checked in by melkaref, 12 years ago

Robocode Plugin code without Mutation Operators

File size: 1.8 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Drawing;
5using System.Data;
6using System.Linq;
7using System.Text;
8using System.Threading.Tasks;
9using System.Windows.Forms;
10using HeuristicLab.Core.Views;
11using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views;
12using HeuristicLab.MainForm;
13using System.Diagnostics;
14using System.IO;
15using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
16
17
18namespace 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}
Note: See TracBrowser for help on using the repository browser.