Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/10/20 17:17:37 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • refactored inheritance structure of json items, now the default JsonItem is an abstract class without properties Value and Range -> splitted up into new interfaces
  • updated view models for new json item structure
  • updated SingleLineArrayJsonWriter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17471 r17473  
    1313    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1414      IValueLookupParameter param = item as IValueLookupParameter;
    15       param.ActualName = CastValue<string>(((IValueLookupJsonItem)data).ActualName);
     15      IValueLookupJsonItem lookupItem = data as IValueLookupJsonItem;
     16      param.ActualName = lookupItem.ActualName;
    1617      if (param.Value != null)
    17         root.Inject(param.Value, data, root);
     18        root.Inject(param.Value, lookupItem.JsonItemReference, root);
    1819    }
    1920
     
    2526      if (param.Value != null) {
    2627        IJsonItem tmp = root.Extract(param.Value, root);
    27         item.Value = tmp.Value;
    28         item.Range = tmp.Range;
    29         item.Name = tmp.Name;
    30         item.Description = tmp.Description;
    3128        item.AddChildren(tmp.Children);
    32         item.Active = tmp.Active;
    3329        item.JsonItemReference = tmp;
    34       } else {
    35         var min = GetMinValue(param.DataType);
    36         var max = GetMaxValue(param.DataType);
    37         if (min != null && max != null)
    38           item.Range = new object[] { min, max };
    39         else
    40           item.Range = null;
    4130      }
    4231      item.Name = param.Name;
Note: See TracChangeset for help on using the changeset viewer.