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.Windows.Forms;
|
---|
9 | using HeuristicLab.MainForm;
|
---|
10 | using HeuristicLab.Core.Views;
|
---|
11 | using HeuristicLab.Core;
|
---|
12 | using HeuristicLab.Data;
|
---|
13 | using HeuristicLab.Problems.MetaOptimization.Views.ValueConfigurationViews;
|
---|
14 |
|
---|
15 | namespace HeuristicLab.Problems.MetaOptimization.Views {
|
---|
16 | /// <summary>
|
---|
17 | /// The visual representation of a <see cref="IRange"/>.
|
---|
18 | /// </summary>
|
---|
19 | [View("Range View")]
|
---|
20 | [Content(typeof(IRange<>), false)]
|
---|
21 | public partial class RangeView : ItemView {
|
---|
22 | /// <summary>
|
---|
23 | /// Gets or sets the variable to represent visually.
|
---|
24 | /// </summary>
|
---|
25 | public new IRange Content {
|
---|
26 | get { return (IRange)base.Content; }
|
---|
27 | set { base.Content = value; }
|
---|
28 | }
|
---|
29 |
|
---|
30 | public RangeView() {
|
---|
31 | InitializeComponent();
|
---|
32 | }
|
---|
33 |
|
---|
34 | protected override void RegisterContentEvents() {
|
---|
35 | base.RegisterContentEvents();
|
---|
36 | }
|
---|
37 |
|
---|
38 | protected override void DeregisterContentEvents() {
|
---|
39 | base.DeregisterContentEvents();
|
---|
40 | }
|
---|
41 |
|
---|
42 | protected override void OnContentChanged() {
|
---|
43 | base.OnContentChanged();
|
---|
44 | if (Content != null) {
|
---|
45 | lowerValueView.Content = (IStringConvertibleValue)Content.LowerBound;
|
---|
46 | upperValueView.Content = (IStringConvertibleValue)Content.UpperBound;
|
---|
47 | stepSizeValueView.Content = (IStringConvertibleValue)Content.StepSize;
|
---|
48 | } else {
|
---|
49 | lowerValueView.Content = null;
|
---|
50 | upperValueView.Content = null;
|
---|
51 | stepSizeValueView.Content = null;
|
---|
52 | }
|
---|
53 | }
|
---|
54 |
|
---|
55 | protected override void SetEnabledStateOfControls() {
|
---|
56 | base.SetEnabledStateOfControls();
|
---|
57 | }
|
---|
58 | }
|
---|
59 | }
|
---|