Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs @ 17790

Last change on this file since 17790 was 17471, checked in by dpiringe, 5 years ago

#3026:

  • deleted INamedMatrixJsonItem and all corresponding classes/views, because of bad design
  • added ILookupJsonItem and IValueLookupJsonItem (incl. all corresponding implementations, VMs, Views)
  • added IResultJsonItem
  • changed type of property Control from JsonItemBaseControl to UserControl in IJsonItemVM (because the details control now builds up with linked user controls -> allows better construction of dynamic controls)
  • added all properties of INamedMatrixJsonItem in IMatrixJsonItem
  • refactored a lot of views for better usage (TableLayoutPanel is used a lot now -> for better item positioning)
  • property ActualName is now located in ILookupJsonItem instead of IJsonItem
File size: 915 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7
8namespace HeuristicLab.JsonInterface {
9  public class LookupParameterConverter : BaseConverter {
10    public override int Priority => 3;
11    public override Type ConvertableType => typeof(ILookupParameter);
12   
13    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
14      ((ILookupParameter)item).ActualName = ((ILookupJsonItem)data).ActualName as string;
15
16    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
17      IParameter parameter = value as IParameter;
18
19      IJsonItem item = new LookupJsonItem() {
20        Name = parameter.Name,
21        Description = parameter.Description,
22        ActualName = ((ILookupParameter)parameter).ActualName
23      };
24      return item;
25    }
26  }
27}
Note: See TracBrowser for help on using the repository browser.