Last change
on this file since 17406 was
17406,
checked in by dpiringe, 4 years ago
|
#3026
- added interfaces IJsonItem and IJsonItemValidator
- replaced every reference JsonItem with IJsonItem
|
File size:
690 bytes
|
Line | |
---|
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.Data;
|
---|
8 |
|
---|
9 | namespace HeuristicLab.JsonInterface {
|
---|
10 | public class StringValueConverter : BaseConverter {
|
---|
11 | public override int Priority => 1;
|
---|
12 | public override Type ConvertableType => typeof(StringValue);
|
---|
13 |
|
---|
14 | public override void InjectData(IItem item, IJsonItem data, IJsonItemConverter root) =>
|
---|
15 | ((StringValue)item).Value = CastValue<string>(data.Value);
|
---|
16 |
|
---|
17 | public override void Populate(IItem value, IJsonItem item, IJsonItemConverter root) =>
|
---|
18 | item.Value = ((StringValue)value).Value;
|
---|
19 | }
|
---|
20 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.