Last change
on this file since 17464 was
17443,
checked in by dpiringe, 5 years ago
|
#3026:
- added support for string values without range limitation (dropdown gets automatically replaced by textbox)
- fixed a UI bug for JsonItemValidValuesControl -> now the control resizes correctly
- fixed a bug in AlgorithmConverter -> now it searches for the ItemName (instead of Name) in method Inject
- fixed a bug in StringValueConverter -> now it sets the correct name
|
File size:
797 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;
|
---|
| 12 | public override Type ConvertableType => typeof(StringValue);
|
---|
[17263] | 13 |
|
---|
[17407] | 14 | public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
|
---|
[17410] | 15 | ((StringValue)item).Value = ((StringJsonItem)data).Value;
|
---|
[17394] | 16 |
|
---|
[17407] | 17 | public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
|
---|
[17410] | 18 | new StringJsonItem() {
|
---|
[17443] | 19 | Name = "[OverridableParamName]",
|
---|
[17433] | 20 | Description = value.ItemDescription,
|
---|
[17407] | 21 | Value = ((StringValue)value).Value
|
---|
| 22 | };
|
---|
[17263] | 23 | }
|
---|
| 24 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.