Free cookie consent management tool by TermsFeed Policy Generator

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

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

#3026

  • in JsonItem:
    • renamed property Default to Value
    • removed usage of Reference for ValueLookupParameter
    • created new property ActualName for the actual name and using property Value for the value of an ValueLookupParameter
  • fixed a bug in ValueTypeMatrixConverter -> now it correctly resizes ValueTypeMatrix<T>
  • fixed a bug in ValueParameterConverter -> when ActualValue is null, but there is data for it, a new instance will get created
File size: 625 bytes
RevLine 
[17266]1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7
[17284]8namespace HeuristicLab.JsonInterface {
[17281]9  public class LookupParameterConverter : ParameterBaseConverter {
[17287]10    public override JsonItem ExtractData(IParameter value) =>
11      new JsonItem() {
12        Name = value.Name,
[17342]13        ActualName = value.Cast<ILookupParameter>().ActualName
[17287]14      };
[17266]15
[17287]16    public override void InjectData(IParameter parameter, JsonItem data) =>
[17342]17      parameter.Cast<ILookupParameter>().ActualName = data.ActualName.Cast<string>();
[17266]18  }
19}
Note: See TracBrowser for help on using the repository browser.