Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/03/20 17:32:50 (5 years ago)
Author:
dpiringe
Message:

#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
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemArrayValueControl.Designer.cs

    r17417 r17420  
    2424    /// </summary>
    2525    private void InitializeComponent() {
    26       components = new System.ComponentModel.Container();
     26      this.dataGridView = new System.Windows.Forms.DataGridView();
     27      this.numericRangeControl1 = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl();
     28      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
     29      this.SuspendLayout();
     30      //
     31      // dataGridView
     32      //
     33      this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
     34            | System.Windows.Forms.AnchorStyles.Left)
     35            | System.Windows.Forms.AnchorStyles.Right)));
     36      this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
     37      this.dataGridView.Location = new System.Drawing.Point(9, 75);
     38      this.dataGridView.Name = "dataGridView";
     39      this.dataGridView.Size = new System.Drawing.Size(487, 171);
     40      this.dataGridView.TabIndex = 13;
     41      //
     42      // numericRangeControl1
     43      //
     44      this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
     45            | System.Windows.Forms.AnchorStyles.Right)));
     46      this.numericRangeControl1.Location = new System.Drawing.Point(9, 252);
     47      this.numericRangeControl1.Name = "numericRangeControl1";
     48      this.numericRangeControl1.Size = new System.Drawing.Size(487, 128);
     49      this.numericRangeControl1.TabIndex = 14;
     50      //
     51      // JsonItemArrayValueControl
     52      //
     53      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    2754      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     55      this.Controls.Add(this.numericRangeControl1);
     56      this.Controls.Add(this.dataGridView);
     57      this.Name = "JsonItemArrayValueControl";
     58      this.Size = new System.Drawing.Size(502, 386);
     59      this.Controls.SetChildIndex(this.dataGridView, 0);
     60      this.Controls.SetChildIndex(this.numericRangeControl1, 0);
     61      ((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
     62      this.ResumeLayout(false);
     63      this.PerformLayout();
     64
    2865    }
    2966
    3067    #endregion
     68
     69    private System.Windows.Forms.DataGridView dataGridView;
     70    private NumericRangeControl numericRangeControl1;
    3171  }
    3272}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemArrayValueControl.cs

    r17417 r17420  
    1010
    1111namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    12   public partial class JsonItemArrayValueControl : JsonItemBaseControl {
    13     public JsonItemArrayValueControl(JsonItemVMBase vm) : base(vm) {
     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) {
    1425      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);
    1535    }
    1636  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs

    r17410 r17420  
    1414
    1515    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) {
    1626      InitializeComponent();
    1727      /*
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValueControl.cs

    r17417 r17420  
    1616    #region Overriden Properties
    1717    protected override string ValuePropertyId => nameof(IntValueVM.Value);
    18     protected override string MinRangePropertyId => nameof(IntValueVM.MinRange);
    19     protected override string MaxRangePropertyId => nameof(IntValueVM.MaxRange);
    20     protected override string EnableMinRangePropertyId => nameof(IntValueVM.EnableMinRange);
    21     protected override string EnableMaxRangePropertyId => nameof(IntValueVM.EnableMaxRange);
    2218    #endregion
    2319
     
    3228    #region Overriden Properties
    3329    protected override string ValuePropertyId => nameof(DoubleValueVM.Value);
    34     protected override string MinRangePropertyId => nameof(DoubleValueVM.MinRange);
    35     protected override string MaxRangePropertyId => nameof(DoubleValueVM.MaxRange);
    36     protected override string EnableMinRangePropertyId => nameof(DoubleValueVM.EnableMinRange);
    37     protected override string EnableMaxRangePropertyId => nameof(DoubleValueVM.EnableMaxRange);
    3830    #endregion
    3931
     
    5244    #region Abstract Properties
    5345    protected abstract string ValuePropertyId { get; }
    54     protected abstract string MinRangePropertyId { get; }
    55     protected abstract string MaxRangePropertyId { get; }
    56     protected abstract string EnableMinRangePropertyId { get; }
    57     protected abstract string EnableMaxRangePropertyId { get; }
    5846    #endregion
    5947
     
    6654    protected void Init() {
    6755      TBValue.DataBindings.Add("Text", base.VM, ValuePropertyId);
    68       NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, MinRangePropertyId);
    69       NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, MaxRangePropertyId);
    70       NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, EnableMinRangePropertyId,
     56      NumericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
     57      NumericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
     58      NumericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
    7159        false, DataSourceUpdateMode.OnPropertyChanged);
    72       NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, EnableMaxRangePropertyId,
     60      NumericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
    7361        false, DataSourceUpdateMode.OnPropertyChanged);
    7462    }
Note: See TracChangeset for help on using the changeset viewer.