Free cookie consent management tool by TermsFeed Policy Generator

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

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

#3026

  • added class for constants -> Constants
  • added new converter -> ValueLookupParameterConverter
  • fixed a bug with type extension IsEqualTo
  • fixed converter priorities
File size: 625 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 : ParameterBaseConverter {
10    public override JsonItem ExtractData(IParameter value) =>
11      new JsonItem() {
12        Name = value.Name,
13        Default = value.Cast<ILookupParameter>().ActualName
14      };
15
16    public override void InjectData(IParameter parameter, JsonItem data) =>
17      parameter.Cast<ILookupParameter>().ActualName = data.Default.Cast<string>();
18   
19  }
20}
Note: See TracBrowser for help on using the repository browser.