Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Shared/JsonItemBaseControl.cs @ 17405

Last change on this file since 17405 was 17405, checked in by dpiringe, 4 years ago

#3026:

  • added a new way to setup the targeted result types
  • added new ui controls: NumericRangeControl, JsonItemArrayControl, JsonItemDefaultControl
  • redesigned export dialog -> now the user can navigate with a tree view
  • enhanced JsonItemVM
File size: 1.2 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;
10
11namespace HeuristicLab.JsonInterface.OptimizerIntegration {
12  public partial class JsonItemBaseControl : UserControl {
13    public JsonItemVM VM { get; set; }
14
15    private JsonItemBaseControl() {
16      InitializeComponent();
17    }
18
19    public JsonItemBaseControl(JsonItemVM vm) {
20      InitializeComponent();
21      VM = vm;
22      checkBoxActive.Checked = VM.Selected;
23      textBoxName.Text = VM.Item.Name;
24      if (string.IsNullOrWhiteSpace(VM.Item.ActualName))
25        textBoxActualName.ReadOnly = true;
26      else
27        textBoxActualName.Text = VM.Item.ActualName;
28    }
29
30    private void checkBoxActive_CheckedChanged(object sender, EventArgs e) {
31      VM.Selected = checkBoxActive.Checked;
32    }
33
34    private void textBoxName_TextChanged(object sender, EventArgs e) {
35      VM.Item.Name = textBoxName.Text;
36    }
37
38    private void textBoxActualName_TextChanged(object sender, EventArgs e) {
39      VM.Item.ActualName = textBoxActualName.Text;
40    }
41  }
42}
Note: See TracBrowser for help on using the repository browser.