Last change
on this file since 17843 was
17843,
checked in by dpiringe, 3 years ago
|
#3026
- removed property ConvertableType from all converters
- removed the option to fixate or loosen the path of JsonItems (obsolete)
- added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
- unified the construction of exporter controls
- code cleanup
|
File size:
823 bytes
|
Rev | Line | |
---|
[17263] | 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 |
|
---|
[17284] | 9 | namespace HeuristicLab.JsonInterface {
|
---|
[17281] | 10 | public class StringValueConverter : BaseConverter {
|
---|
[17394] | 11 | public override int Priority => 1;
|
---|
[17263] | 12 |
|
---|
[17828] | 13 | public override bool CanConvertType(Type t) =>
|
---|
[17843] | 14 | typeof(StringValue).IsAssignableFrom(t);
|
---|
[17828] | 15 |
|
---|
[17407] | 16 | public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
|
---|
[17410] | 17 | ((StringValue)item).Value = ((StringJsonItem)data).Value;
|
---|
[17394] | 18 |
|
---|
[17407] | 19 | public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
|
---|
[17410] | 20 | new StringJsonItem() {
|
---|
[17473] | 21 | Name = value.ItemName,
|
---|
[17433] | 22 | Description = value.ItemDescription,
|
---|
[17407] | 23 | Value = ((StringValue)value).Value
|
---|
| 24 | };
|
---|
[17263] | 25 | }
|
---|
| 26 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.