Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemArrayValueControl.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: 1.5 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 
13  public class JsonItemIntArrayValueControl : JsonItemArrayValueControl {
14    public JsonItemIntArrayValueControl(IntArrayValueVM vm) : base(vm, vm.Value) { }
15  }
16
17  public class JsonItemDoubleArrayValueControl : JsonItemArrayValueControl {
18    public JsonItemDoubleArrayValueControl(DoubleArrayValueVM vm) : base(vm, vm.Value) { }
19  }
20 
21  public abstract partial class JsonItemArrayValueControl : JsonItemBaseControl {
22    protected NumericRangeControl NumericRangeControl { get; set; }
23
24    public JsonItemArrayValueControl(JsonItemVMBase vm, object dataSource) : base(vm) {
25      InitializeComponent();
26      dataGridView.DataSource = dataSource;
27      NumericRangeControl = numericRangeControl1;
28
29      NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
30      NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
31      NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
32        false, DataSourceUpdateMode.OnPropertyChanged);
33      NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
34        false, DataSourceUpdateMode.OnPropertyChanged);
35    }
36  }
37}
Note: See TracBrowser for help on using the repository browser.