Last change
on this file since 17590 was
17473,
checked in by dpiringe, 5 years ago
|
#3026:
- refactored inheritance structure of json items, now the default JsonItem is an abstract class without properties Value and Range -> splitted up into new interfaces
- updated view models for new json item structure
- updated SingleLineArrayJsonWriter
|
File size:
1.4 KB
|
Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Threading.Tasks;
|
---|
6 |
|
---|
7 | namespace HeuristicLab.JsonInterface.OptimizerIntegration {
|
---|
8 |
|
---|
9 | public abstract class RangedValueBaseVM<T, JsonItemType> : JsonItemVMBase<JsonItemType>
|
---|
10 | where T : IComparable
|
---|
11 | where JsonItemType : class, IIntervalRestrictedJsonItem<T>
|
---|
12 | {
|
---|
13 | public T MinRange {
|
---|
14 | get => Item.Minimum;
|
---|
15 | set {
|
---|
16 | Item.Minimum = value;
|
---|
17 | OnPropertyChange(this, nameof(MinRange));
|
---|
18 | }
|
---|
19 | }
|
---|
20 |
|
---|
21 | public T MaxRange {
|
---|
22 | get => Item.Maximum;
|
---|
23 | set {
|
---|
24 | Item.Maximum = value;
|
---|
25 | OnPropertyChange(this, nameof(MaxRange));
|
---|
26 | }
|
---|
27 | }
|
---|
28 |
|
---|
29 | private bool enableMinRange = false;
|
---|
30 | public bool EnableMinRange {
|
---|
31 | get => enableMinRange;
|
---|
32 | set {
|
---|
33 | enableMinRange = value;
|
---|
34 | if (!enableMinRange)
|
---|
35 | MinRange = MinTypeValue;
|
---|
36 | OnPropertyChange(this, nameof(EnableMinRange));
|
---|
37 | }
|
---|
38 | }
|
---|
39 |
|
---|
40 | private bool enableMaxRange = false;
|
---|
41 | public bool EnableMaxRange {
|
---|
42 | get => enableMaxRange;
|
---|
43 | set {
|
---|
44 | enableMaxRange = value;
|
---|
45 | if (!enableMaxRange)
|
---|
46 | MaxRange = MaxTypeValue;
|
---|
47 | OnPropertyChange(this, nameof(EnableMaxRange));
|
---|
48 | }
|
---|
49 | }
|
---|
50 |
|
---|
51 | protected abstract T MinTypeValue { get; }
|
---|
52 | protected abstract T MaxTypeValue { get; }
|
---|
53 | }
|
---|
54 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.