Changeset 17411 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels
- Timestamp:
- 01/28/20 16:21:53 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17410 r17411 7 7 8 8 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 public abstractclass JsonItemVMBase : INotifyPropertyChanged {9 public class JsonItemVMBase : INotifyPropertyChanged { 10 10 public event PropertyChangedEventHandler PropertyChanged; 11 11 public IJsonItem Item { get; set; } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs
r17410 r17411 18 18 } 19 19 20 public abstract class RangeVM<T> : JsonItemVM {20 public abstract class RangeVM<T> : JsonItemVMBase { 21 21 22 22 public T MinValue { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs
r17410 r17411 10 10 public class IntValueVM : SingleValueVM<int> { 11 11 public override Type JsonItemType => typeof(IntJsonItem); 12 13 protected override int MinTypeValue => int.MinValue; 14 protected override int MaxTypeValue => int.MaxValue; 15 12 16 public override JsonItemBaseControl GetControl() => 13 17 new JsonItemIntValueControl(this); … … 15 19 16 20 public class DoubleValueVM : SingleValueVM<double> { 17 public override Type JsonItemType => typeof(DoubleJsonItem); 21 public override Type JsonItemType => typeof(DoubleJsonItem); 22 23 protected override double MinTypeValue => double.MinValue; 24 protected override double MaxTypeValue => double.MaxValue; 25 18 26 public override JsonItemBaseControl GetControl() => 19 27 new JsonItemDoubleValueControl(this); … … 22 30 public class BoolValueVM : SingleValueVM<bool> { 23 31 public override Type JsonItemType => typeof(BoolJsonItem); 32 33 protected override bool MinTypeValue => false; 34 protected override bool MaxTypeValue => true; 35 24 36 public override JsonItemBaseControl GetControl() => 25 37 new JsonItemBoolControl(this); 26 38 } 27 39 28 public abstract class SingleValueVM<T> : JsonItemVM {40 public abstract class SingleValueVM<T> : JsonItemVMBase { 29 41 30 42 public T Value { … … 52 64 } 53 65 66 private bool enableMinRange = false; 67 public bool EnableMinRange { 68 get => enableMinRange; 69 set { 70 enableMinRange = value; 71 if (!enableMinRange) 72 MinRange = MinTypeValue; 73 OnPropertyChange(this, nameof(EnableMinRange)); 74 } 75 } 76 77 private bool enableMaxRange = false; 78 public bool EnableMaxRange { 79 get => enableMaxRange; 80 set { 81 enableMaxRange = value; 82 if (!enableMaxRange) 83 MaxRange = MaxTypeValue; 84 OnPropertyChange(this, nameof(EnableMaxRange)); 85 } 86 } 87 54 88 private T Cast(object obj) => (T)Convert.ChangeType(obj, typeof(T)); 55 89 … … 59 93 } 60 94 95 protected abstract T MinTypeValue { get; } 96 protected abstract T MaxTypeValue { get; } 61 97 } 62 98 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs
r17410 r17411 6 6 7 7 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 public class StringValueVM : JsonItemVM {8 public class StringValueVM : JsonItemVMBase { 9 9 public override Type JsonItemType => typeof(StringJsonItem); 10 10 public override JsonItemBaseControl GetControl() =>
Note: See TracChangeset
for help on using the changeset viewer.