Last change
on this file since 17712 was
17473,
checked in by dpiringe, 5 years ago
|
#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 size:
857 bytes
|
Rev | Line | |
---|
[17446] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Threading.Tasks;
|
---|
| 6 | using HeuristicLab.Core;
|
---|
| 7 | using HeuristicLab.Optimization;
|
---|
| 8 |
|
---|
| 9 | namespace HeuristicLab.JsonInterface {
|
---|
| 10 | public class ResultParameterConverter : BaseConverter {
|
---|
| 11 | public override int Priority => 5;
|
---|
| 12 |
|
---|
| 13 | public override Type ConvertableType => typeof(IResultParameter);
|
---|
| 14 |
|
---|
| 15 | public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
|
---|
| 16 | IResultParameter res = value as IResultParameter;
|
---|
[17451] | 17 | return new ResultJsonItem() {
|
---|
[17446] | 18 | Name = res.ActualName,
|
---|
| 19 | Description = res.Description
|
---|
| 20 | };
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
|
---|
| 24 | IResultParameter res = item as IResultParameter;
|
---|
[17473] | 25 | res.ActualName = data.Name;
|
---|
[17446] | 26 | }
|
---|
| 27 | }
|
---|
| 28 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.