Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs @ 17843

Last change on this file since 17843 was 17843, checked in by dpiringe, 3 years ago

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
File size: 1.4 KB
RevLine 
[17420]1using System;
[17828]2using System.Windows.Forms;
[17420]3
4namespace HeuristicLab.JsonInterface.OptimizerIntegration {
5
[17473]6  public abstract class RangedValueBaseVM<T, JsonItemType> : JsonItemVMBase<JsonItemType>
7    where T : IComparable
8    where JsonItemType : class, IIntervalRestrictedJsonItem<T>
9  {
[17828]10    public override UserControl Control => NumericRangeControl.Create(this);
11
[17420]12    public T MinRange {
[17473]13      get => Item.Minimum;
[17420]14      set {
[17473]15        Item.Minimum = value;
[17420]16        OnPropertyChange(this, nameof(MinRange));
17      }
18    }
19
20    public T MaxRange {
[17473]21      get => Item.Maximum;
[17420]22      set {
[17473]23        Item.Maximum = value;
[17420]24        OnPropertyChange(this, nameof(MaxRange));
25      }
26    }
27
28    private bool enableMinRange = false;
29    public bool EnableMinRange {
30      get => enableMinRange;
31      set {
32        enableMinRange = value;
33        if (!enableMinRange)
34          MinRange = MinTypeValue;
35        OnPropertyChange(this, nameof(EnableMinRange));
36      }
37    }
38
39    private bool enableMaxRange = false;
40    public bool EnableMaxRange {
41      get => enableMaxRange;
42      set {
43        enableMaxRange = value;
44        if (!enableMaxRange)
45          MaxRange = MaxTypeValue;
46        OnPropertyChange(this, nameof(EnableMaxRange));
47      }
48    }
[17473]49   
[17420]50    protected abstract T MinTypeValue { get; }
51    protected abstract T MaxTypeValue { get; }
52  }
53}
Note: See TracBrowser for help on using the repository browser.