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 System.Globalization;
|
---|
11 |
|
---|
12 | namespace HeuristicLab.JsonInterface.OptimizerIntegration {
|
---|
13 | public partial class JsonItemRangeControl : JsonItemBaseControl {
|
---|
14 |
|
---|
15 | public JsonItemRangeControl(DoubleRangeVM vm) : base(vm) {
|
---|
16 | InitializeComponent();
|
---|
17 | /*
|
---|
18 | this.isDouble = isDouble;
|
---|
19 | textBoxValueFrom.Text = ((Array)VM.Item.Value).GetValue(0).ToString();
|
---|
20 | textBoxValueTo.Text = ((Array)VM.Item.Value).GetValue(1).ToString();
|
---|
21 | textBoxValueFrom.Text = VM.Item.Range.First().ToString();
|
---|
22 | textBoxValueTo.Text = VM.Item.Range.Last().ToString();
|
---|
23 | */
|
---|
24 | }
|
---|
25 | /*
|
---|
26 | protected abstract object Parse(string s);
|
---|
27 |
|
---|
28 | private void SetValue() {
|
---|
29 | if (!string.IsNullOrWhiteSpace(textBoxValueFrom.Text))
|
---|
30 | value[0] = Parse(textBoxValueFrom.Text);
|
---|
31 | else
|
---|
32 | value[0] = ((Array)VM.Item.Value).GetValue(0);
|
---|
33 |
|
---|
34 | if (!string.IsNullOrWhiteSpace(textBoxValueTo.Text))
|
---|
35 | value[1] = Parse(textBoxValueTo.Text);
|
---|
36 | else
|
---|
37 | value[1] = ((Array)VM.Item.Value).GetValue(1);
|
---|
38 | VM.Item.Value = value;
|
---|
39 | }
|
---|
40 |
|
---|
41 | private void textBoxValueFrom_Leave(object sender, EventArgs e) {
|
---|
42 | SetValue();
|
---|
43 | }
|
---|
44 |
|
---|
45 | private void textBoxValueTo_Leave(object sender, EventArgs e) {
|
---|
46 | SetValue();
|
---|
47 | }
|
---|
48 |
|
---|
49 | private void numericRangeControl1_Load(object sender, EventArgs e) {
|
---|
50 | numericRangeControl1.IsDouble = isDouble;
|
---|
51 | numericRangeControl1.VM = VM;
|
---|
52 | }
|
---|
53 | */
|
---|
54 | }
|
---|
55 | }
|
---|