Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs @ 17420

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

#3026:

  • refactored ranged based VMs -> created new 'base' class for ranged based VMs RangedValueBaseVM
  • renamed AddChilds to AddChildren
  • implemented ArrayValueVM and JsonItemArrayValueControl
  • added ranges for array and matrix values
File size: 2.1 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 System.Globalization;
11
12namespace 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    public JsonItemRangeControl(IntRangeVM vm) : base(vm) {
26      InitializeComponent();
27      /*
28      this.isDouble = isDouble;
29      textBoxValueFrom.Text = ((Array)VM.Item.Value).GetValue(0).ToString();
30      textBoxValueTo.Text = ((Array)VM.Item.Value).GetValue(1).ToString();
31      textBoxValueFrom.Text = VM.Item.Range.First().ToString();
32      textBoxValueTo.Text = VM.Item.Range.Last().ToString();
33      */
34    }
35    /*
36    protected abstract object Parse(string s);
37
38    private void SetValue() {
39      if (!string.IsNullOrWhiteSpace(textBoxValueFrom.Text))
40        value[0] = Parse(textBoxValueFrom.Text);
41      else
42        value[0] = ((Array)VM.Item.Value).GetValue(0);
43
44      if (!string.IsNullOrWhiteSpace(textBoxValueTo.Text))
45        value[1] = Parse(textBoxValueTo.Text);
46      else
47        value[1] = ((Array)VM.Item.Value).GetValue(1);
48      VM.Item.Value = value;
49    }
50   
51    private void textBoxValueFrom_Leave(object sender, EventArgs e) {
52      SetValue();
53    }
54
55    private void textBoxValueTo_Leave(object sender, EventArgs e) {
56      SetValue();
57    }
58
59    private void numericRangeControl1_Load(object sender, EventArgs e) {
60      numericRangeControl1.IsDouble = isDouble;
61      numericRangeControl1.VM = VM;
62    }
63    */
64  }
65}
Note: See TracBrowser for help on using the repository browser.