Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs @ 17712

Last change on this file since 17712 was 17519, checked in by dpiringe, 5 years ago

#3026:

  • added error output for failed runner initialization
  • reorganised some final view models
  • TargetedJsonItemType (in JsonItemVMBase) now automatically returns the type of the defined JsonItem
  • code cleanup
  • refactored RegressionProblemDataConverter
  • added lots of comments
  • added new view for StringArrayJsonItem
  • added new UI component for concrete restricted items and used it in JsonItemConcreteItemArrayControl and JsonItemValidValuesControl
File size: 1.3 KB
RevLine 
[17417]1using System;
2using System.Collections.Generic;
[17420]3using System.ComponentModel;
[17417]4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
[17471]7using System.Windows.Forms;
[17417]8
9namespace HeuristicLab.JsonInterface.OptimizerIntegration {
[17420]10
[17519]11 
[17420]12
13
14
[17519]15  /*
16  public class StringArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {
17    public override Type TargetedJsonItemType => typeof(StringArrayJsonItem);
[17420]18
19    protected override int MinTypeValue => int.MinValue;
20
21    protected override int MaxTypeValue => int.MaxValue;
22
[17471]23    public override UserControl Control =>
[17464]24      new JsonItemBaseControl(this, new JsonItemIntArrayValueControl(this));
[17519]25
[17431]26    public override int[] Value {
[17484]27      get => Item.Value;
[17431]28      set {
[17484]29        Item.Value = value;
[17431]30        OnPropertyChange(this, nameof(Value));
[17420]31      }
32    }
33  }
[17519]34  */
[17420]35
[17519]36
[17473]37  public abstract class ArrayValueVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>, IArrayJsonItemVM
38    where T : IComparable
39    where JsonItemType : class, IArrayJsonItem, IIntervalRestrictedJsonItem<T> {
[17431]40   
[17433]41    public ArrayValueVM() { }
[17484]42   
[17431]43    public abstract T[] Value { get; set; }
[17446]44    public bool Resizable {
[17484]45      get => Item.Resizable;
[17446]46      set {
[17484]47        Item.Resizable = value;
[17446]48        OnPropertyChange(this, nameof(IArrayJsonItemVM.Resizable));
49      }
50    }
[17420]51  }
[17417]52}
Note: See TracBrowser for help on using the repository browser.