Changeset 17484 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
- Timestamp:
- 03/23/20 15:16:55 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
r17473 r17484 20 20 21 21 public override double[] Value { 22 get => ((DoubleArrayJsonItem)Item).Value;22 get => Item.Value; 23 23 set { 24 ((DoubleArrayJsonItem)Item).Value = value;24 Item.Value = value; 25 25 OnPropertyChange(this, nameof(Value)); 26 26 } … … 39 39 40 40 public override int[] Value { 41 get => ((IntArrayJsonItem)Item).Value;41 get => Item.Value; 42 42 set { 43 ((IntArrayJsonItem)Item).Value = value;43 Item.Value = value; 44 44 OnPropertyChange(this, nameof(Value)); 45 45 } … … 52 52 53 53 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 66 55 public abstract T[] Value { get; set; } 67 56 public bool Resizable { 68 get => ((IArrayJsonItem)Item).Resizable;57 get => Item.Resizable; 69 58 set { 70 ((IArrayJsonItem)Item).Resizable = value;59 Item.Resizable = value; 71 60 OnPropertyChange(this, nameof(IArrayJsonItemVM.Resizable)); 72 61 }
Note: See TracChangeset
for help on using the changeset viewer.