Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17454


Ignore:
Timestamp:
02/26/20 13:23:49 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • fixed a type conversion bug in RangeVM
  • implemented logic for JsonItemRangeControl
Location:
branches/3026_IntegrationIntoSymSpace
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs

    r17446 r17454  
    3535      get => Cast(((Array)Item.Value).GetValue(0));
    3636      set {
    37         SetValue(value, ((Array)Item.Value).GetValue(1));
     37        SetValue(value, (T)((Array)Item.Value).GetValue(1));
    3838        OnPropertyChange(this, nameof(MinValue));
    3939      }
     
    4343      get => Cast(((Array)Item.Value).GetValue(1));
    4444      set {
    45         SetValue(((Array)Item.Value).GetValue(0), value);
     45        SetValue((T)((Array)Item.Value).GetValue(0), value);
    4646        OnPropertyChange(this, nameof(MaxValue));
    4747      }
    4848    }
    4949
    50     private void SetValue(object min, object max) =>
    51       Item.Value = new object[] { min, max };
     50    private void SetValue(T min, T max) =>
     51      Item.Value = new T[] { min, max };
    5252  }
    5353}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.Designer.cs

    r17443 r17454  
    2929      this.label4 = new System.Windows.Forms.Label();
    3030      this.label2 = new System.Windows.Forms.Label();
    31       this.numericRangeControl1 = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl();
     31      this.numericRangeControl = new HeuristicLab.JsonInterface.OptimizerIntegration.NumericRangeControl();
     32      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).BeginInit();
    3233      this.groupBox1.SuspendLayout();
    3334      this.SuspendLayout();
     
    4142      this.groupBox1.Controls.Add(this.label4);
    4243      this.groupBox1.Controls.Add(this.label2);
    43       this.groupBox1.Location = new System.Drawing.Point(9, 101);
     44      this.groupBox1.Location = new System.Drawing.Point(7, 101);
    4445      this.groupBox1.Name = "groupBox1";
    45       this.groupBox1.Size = new System.Drawing.Size(487, 64);
     46      this.groupBox1.Size = new System.Drawing.Size(487, 65);
    4647      this.groupBox1.TabIndex = 17;
    4748      this.groupBox1.TabStop = false;
     
    5253      this.textBoxValueTo.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    5354            | System.Windows.Forms.AnchorStyles.Right)));
    54       this.textBoxValueTo.Location = new System.Drawing.Point(249, 36);
     55      this.textBoxValueTo.Location = new System.Drawing.Point(83, 39);
    5556      this.textBoxValueTo.Name = "textBoxValueTo";
    56       this.textBoxValueTo.Size = new System.Drawing.Size(230, 20);
     57      this.textBoxValueTo.Size = new System.Drawing.Size(398, 20);
    5758      this.textBoxValueTo.TabIndex = 3;
    5859      //
    5960      // textBoxValueFrom
    6061      //
    61       this.textBoxValueFrom.Location = new System.Drawing.Point(10, 36);
     62      this.textBoxValueFrom.Location = new System.Drawing.Point(83, 13);
    6263      this.textBoxValueFrom.Name = "textBoxValueFrom";
    63       this.textBoxValueFrom.Size = new System.Drawing.Size(230, 20);
     64      this.textBoxValueFrom.Size = new System.Drawing.Size(398, 20);
    6465      this.textBoxValueFrom.TabIndex = 2;
    6566      //
     
    6970            | System.Windows.Forms.AnchorStyles.Right)));
    7071      this.label4.AutoSize = true;
    71       this.label4.Location = new System.Drawing.Point(246, 20);
     72      this.label4.Location = new System.Drawing.Point(6, 42);
    7273      this.label4.Name = "label4";
    73       this.label4.Size = new System.Drawing.Size(20, 13);
     74      this.label4.Size = new System.Drawing.Size(23, 13);
    7475      this.label4.TabIndex = 1;
    75       this.label4.Text = "To";
     76      this.label4.Text = "To:";
    7677      //
    7778      // label2
     
    8081            | System.Windows.Forms.AnchorStyles.Right)));
    8182      this.label2.AutoSize = true;
    82       this.label2.Location = new System.Drawing.Point(7, 20);
     83      this.label2.Location = new System.Drawing.Point(6, 16);
    8384      this.label2.Name = "label2";
    84       this.label2.Size = new System.Drawing.Size(30, 13);
     85      this.label2.Size = new System.Drawing.Size(33, 13);
    8586      this.label2.TabIndex = 0;
    86       this.label2.Text = "From";
     87      this.label2.Text = "From:";
    8788      //
    88       // numericRangeControl1
     89      // numericRangeControl
    8990      //
    90       this.numericRangeControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
     91      this.numericRangeControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    9192            | System.Windows.Forms.AnchorStyles.Right)));
    92       this.numericRangeControl1.Location = new System.Drawing.Point(9, 171);
    93       this.numericRangeControl1.Name = "numericRangeControl1";
    94       this.numericRangeControl1.Size = new System.Drawing.Size(487, 112);
    95       this.numericRangeControl1.TabIndex = 18;
     93      this.numericRangeControl.Location = new System.Drawing.Point(7, 172);
     94      this.numericRangeControl.Name = "numericRangeControl";
     95      this.numericRangeControl.Size = new System.Drawing.Size(487, 74);
     96      this.numericRangeControl.TabIndex = 18;
    9697      //
    9798      // JsonItemRangeControl
     
    99100      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    100101      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    101       this.Controls.Add(this.numericRangeControl1);
     102      this.Controls.Add(this.numericRangeControl);
    102103      this.Controls.Add(this.groupBox1);
     104      this.errorProvider.SetIconAlignment(this, System.Windows.Forms.ErrorIconAlignment.MiddleLeft);
    103105      this.Name = "JsonItemRangeControl";
    104       this.Size = new System.Drawing.Size(500, 290);
     106      this.Size = new System.Drawing.Size(500, 252);
    105107      this.Controls.SetChildIndex(this.groupBox1, 0);
    106       this.Controls.SetChildIndex(this.numericRangeControl1, 0);
     108      this.Controls.SetChildIndex(this.numericRangeControl, 0);
     109      ((System.ComponentModel.ISupportInitialize)(this.errorProvider)).EndInit();
    107110      this.groupBox1.ResumeLayout(false);
    108111      this.groupBox1.PerformLayout();
     
    119122    private System.Windows.Forms.Label label4;
    120123    private System.Windows.Forms.Label label2;
    121     private NumericRangeControl numericRangeControl1;
     124    private NumericRangeControl numericRangeControl;
    122125  }
    123126}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.cs

    r17420 r17454  
    1515    public JsonItemRangeControl(DoubleRangeVM vm) : base(vm) {
    1616      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       */
     17      textBoxValueFrom.DataBindings.Add("Text", vm, nameof(vm.MinValue));
     18      textBoxValueTo.DataBindings.Add("Text", vm, nameof(vm.MaxValue));
     19      InitNumbericRangeControl();
     20
    2421    }
    2522    public JsonItemRangeControl(IntRangeVM vm) : base(vm) {
    2623      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       */
     24      textBoxValueFrom.DataBindings.Add("Text", vm, nameof(vm.MinValue));
     25      textBoxValueTo.DataBindings.Add("Text", vm, nameof(vm.MaxValue));
     26      InitNumbericRangeControl();
    3427    }
     28
     29    private void InitNumbericRangeControl() {
     30      numericRangeControl.TBMinRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MinRange));
     31      numericRangeControl.TBMaxRange.DataBindings.Add("Text", VM, nameof(RangedValueBaseVM.MaxRange));
     32      numericRangeControl.EnableMinRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMinRange),
     33        false, DataSourceUpdateMode.OnPropertyChanged);
     34      numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", VM, nameof(RangedValueBaseVM.EnableMaxRange),
     35        false, DataSourceUpdateMode.OnPropertyChanged);
     36    }
     37
    3538    /*
    3639    protected abstract object Parse(string s);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemRangeControl.resx

    r17404 r17454  
    118118    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
    119119  </resheader>
     120  <metadata name="errorProvider.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
     121    <value>17, 17</value>
     122  </metadata>
    120123</root>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntJsonItems.cs

    r17451 r17454  
    77namespace HeuristicLab.JsonInterface {
    88  public class IntJsonItem : JsonItem<int> {
    9     /*I
     9    /*
    1010    public int MinValue { get; set; }
    1111    public int MaxValue { get; set; }
Note: See TracChangeset for help on using the changeset viewer.