Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/20 15:16:55 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • fixed a bug with JsonItemMultiValueControl -> the size of the matrix should now be saved correctly
  • fixed a bug with RegressionProblemDataConverter -> should now set the row/col sizes correctly
  • simplified the code for saving matrix data in JsonItemMultiValueControl, MatrixValueVM and ArrayValueVM
  • removed unnecessary casts
File:
1 edited

Legend:

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

    r17473 r17484  
    2020   
    2121    public override double[] Value {
    22       get => ((DoubleArrayJsonItem)Item).Value;
     22      get => Item.Value;
    2323      set {
    24         ((DoubleArrayJsonItem)Item).Value = value;
     24        Item.Value = value;
    2525        OnPropertyChange(this, nameof(Value));
    2626      }
     
    3939   
    4040    public override int[] Value {
    41       get => ((IntArrayJsonItem)Item).Value;
     41      get => Item.Value;
    4242      set {
    43         ((IntArrayJsonItem)Item).Value = value;
     43        Item.Value = value;
    4444        OnPropertyChange(this, nameof(Value));
    4545      }
     
    5252   
    5353    public ArrayValueVM() { }
    54 
    55     public void SetIndexValue(T data, int index) {
    56       T[] tmp = Value;
    57       if(index >= tmp.Length) { // increasing array
    58         T[] newArr = new T[index+1];
    59         Array.Copy(tmp, 0, newArr, 0, tmp.Length);
    60         tmp = newArr;
    61       }
    62       tmp[index] = data;
    63       Value = tmp;
    64     }
    65 
     54   
    6655    public abstract T[] Value { get; set; }
    6756    public bool Resizable {
    68       get => ((IArrayJsonItem)Item).Resizable;
     57      get => Item.Resizable;
    6958      set {
    70         ((IArrayJsonItem)Item).Resizable = value;
     59        Item.Resizable = value;
    7160        OnPropertyChange(this, nameof(IArrayJsonItemVM.Resizable));
    7261      }
Note: See TracChangeset for help on using the changeset viewer.