source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ValueLookupJsonItemVM.cs @ 17477

Last change on this file since 17477 was 17477, checked in by dpiringe, 13 months ago

#3026:

  • refactored JsonTemplateInstantiator -> now returns a InstantiatorResult which contains the optimizer and an IEnumerable of IResultJsonItem
  • code cleanup in JCGenerator
  • relocated the serialization of json items into IJsonItem with method GenerateJObject (virtual base implementation in JsonItem)
    • this allows custom serialization for json items (example: ValueLookupJsonItem)
    • items of interface IIntervalRestrictedJsonItem have a custom implementation of GenerateJObject -> hides Minimum and Maximum if the values are the physically min/max of their type
  • code cleanup in BaseConverter
File size: 742 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using System.Windows.Forms;
7
8namespace HeuristicLab.JsonInterface.OptimizerIntegration {
9  public class ValueLookupJsonItemVM : LookupJsonItemVM, IValueLookupJsonItemVM {
10    public override Type TargetedJsonItemType => typeof(ValueLookupJsonItem);
11    public override UserControl Control => new ValueLookupJsonItemControl(this);
12    public IJsonItem JsonItemReference => ((IValueLookupJsonItem)Item).ActualValue;
13
14    public ValueLookupJsonItemVM() {
15      base.SelectedChanged += () => {
16        if (JsonItemReference != null)
17          JsonItemReference.Active = base.Selected;
18      };
19    }
20  }
21}
Note: See TracBrowser for help on using the repository browser.