source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterBaseConverter.cs @ 17284

Last change on this file since 17284 was 17284, checked in by dpiringe, 3 years ago

#3026: renamed namespace and project from HeuristicLab.Manufacture to HeuristicLab.JsonInterface

File size: 1.0 KB
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 abstract class ParameterBaseConverter : BaseConverter {
10    public override JsonItem ExtractData(IItem value) {
11      IParameter param = value.Cast<IParameter>();
12      JsonItem comp = ExtractData(param);
13      //comp.Path = value.Cast<IParameter>().ActualValue?.ItemName;
14      /*comp.Path = value.Cast<IParameter>().Name + "." + comp.Path;
15      if(comp.ParameterizedItems != null) {
16        foreach (var item in comp.ParameterizedItems) {
17          item.Path = value.Cast<IParameter>().Name + "." + item.Path;
18        }
19      }*/
20      return comp;
21    }
22    public abstract JsonItem ExtractData(IParameter value);
23
24    public override void InjectData(IItem item, JsonItem data) => InjectData(item.Cast<IParameter>(), data);
25
26    public abstract void InjectData(IParameter parameter, JsonItem data);
27  }
28}
Note: See TracBrowser for help on using the repository browser.