Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/01/21 14:37:18 (3 years ago)
Author:
dpiringe
Message:

#3026

  • removed the option to set the value for JsonItems via exporter
    • reworked some base controls
    • added new controls for JsonItem specific properties (e.g. ArrayResizable)
    • deleted a lot of obsolet controls
  • removed the Enable checkbox in the detail view of JsonItems
  • exporter now clones the IOptimizer object
  • added a check + message for unsupported exports
  • list of JsonItems now includes unsupported JsonItems (disabled and marked with 'unsupported')
  • refactored the converter type check
    • now every converter has to specify its supported type(s)
Location:
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs

    r17451 r17828  
    1212
    1313    public override Type ConvertableType => typeof(IAlgorithm);
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x == ConvertableType);
    1417
    1518    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs

    r17477 r17828  
    1212  {
    1313    public abstract int Priority { get; }
     14
     15    public abstract bool CanConvertType(Type t);
     16
    1417    public abstract Type ConvertableType { get; }
    1518
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BatchRunConverter.cs

    r17540 r17828  
    1010    public override int Priority => 10;
    1111    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("E85407E0-18EC-4198-8321-9CF030FDF6D7"));
     12
     13    public override bool CanConvertType(Type t) => ConvertableType.IsAssignableFrom(t);
    1214
    1315    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
     
    3133        Maximum = int.MaxValue
    3234      });
    33      
    3435      return batchRunJI;
    3536    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs

    r17485 r17828  
    1111    public override int Priority => 3;
    1212    public override Type ConvertableType => typeof(IConstrainedValueParameter<>);
     13
     14    public override bool CanConvertType(Type t) =>
     15      t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(IConstrainedValueParameter<>));
    1316
    1417    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs

    r17473 r17828  
    1111    public override int Priority => 1;
    1212    public override Type ConvertableType => typeof(EnumValue<>);
     13
     14    public override bool CanConvertType(Type t) =>
     15      typeof(EnumValue<>).IsAssignableFrom(t) ||
     16      (t.IsGenericType && t.GetGenericTypeDefinition() == ConvertableType);
    1317
    1418    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    2529        Value = Enum.GetName(enumType, val),
    2630        ConcreteRestrictedItems = Enum.GetNames(enumType)
    27     };
     31      };
    2832    }
    2933  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ExperimentConverter.cs

    r17540 r17828  
    1111    public override int Priority => 10;
    1212    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("A8A4536B-54C1-4A17-AB58-A6006F7F394B"));
     13
     14    public override bool CanConvertType(Type t) =>
     15      ConvertableType.IsAssignableFrom(t);
    1316
    1417    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs

    r17471 r17828  
    1010    public override int Priority => 3;
    1111    public override Type ConvertableType => typeof(ILookupParameter);
    12    
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(ILookupParameter));
     15
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    1417      ((ILookupParameter)item).ActualName = ((ILookupJsonItem)data).ActualName as string;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs

    r17484 r17828  
    1010  public class MultiCheckedOperatorConverter : ParameterizedItemConverter {
    1111    public override int Priority => 3;
     12
    1213    public override Type ConvertableType => typeof(ICheckedMultiOperator<>);
    13    
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == ConvertableType);
     17
    1418    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1519      base.Inject(item, data, root);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs

    r17473 r17828  
    1010    public override int Priority => 2;
    1111    public override Type ConvertableType => typeof(IParameterizedItem);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IParameterizedItem));
    1215
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942      return item;
    4043    }
     44
    4145  }
    4246}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r17560 r17828  
    3434    public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C"));
    3535
     36    public override bool CanConvertType(Type t) =>
     37      ConvertableType.IsAssignableFrom(t);
     38
    3639    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    3740
     
    180183        if(it != null) {
    181184          if(it.MoveNext() && it.Current is double) {
    182             CreateMatrix(dict, out IList<string> rowNames, out double[][] mat);
     185            CreateMatrix(dict, out IList<string> columnNames, out double[][] mat);
    183186            return new DoubleMatrixJsonItem() {
    184187              Name = Dataset,
    185188              Value = mat,
    186               RowNames = rowNames,
     189              ColumnNames = columnNames,
    187190              Minimum = double.MinValue,
    188191              Maximum = double.MaxValue
    189192            };
    190193          } else if(it.Current is int) {
    191             CreateMatrix(dict, out IList<string> rowNames, out int[][] mat);
     194            CreateMatrix(dict, out IList<string> columnNames, out int[][] mat);
    192195            return new IntMatrixJsonItem() {
    193196              Name = Dataset,
    194197              Value = mat,
    195               RowNames = rowNames,
     198              ColumnNames = columnNames,
    196199              Minimum = int.MinValue,
    197200              Maximum = int.MaxValue
    198201            };
    199202          } else if (it.Current is bool) {
    200             CreateMatrix(dict, out IList<string> rowNames, out bool[][] mat);
     203            CreateMatrix(dict, out IList<string> columnNames, out bool[][] mat);
    201204            return new BoolMatrixJsonItem() {
    202205              Name = Dataset,
    203206              Value = mat,
    204               RowNames = rowNames
     207              ColumnNames = columnNames
    205208            };
    206209          }
     
    210213    }
    211214   
    212     private void CreateMatrix<T>(Dictionary<string, IList> dict, out IList<string> rowNames, out T[][] matrix) {
     215    private void CreateMatrix<T>(Dictionary<string, IList> dict, out IList<string> columnNames, out T[][] matrix) {
    213216      int cols = dict.Count, rows = 0, c = 0;
    214       rowNames = new List<string>();
     217      columnNames = new List<string>();
    215218      matrix = new T[cols][];
    216219      foreach (var x in dict) {
    217220        rows = Math.Max(rows, x.Value.Count);
    218         rowNames.Add(x.Key);
     221        columnNames.Add(x.Key);
    219222
    220223        matrix[c] = new T[rows];
     224
    221225        int r = 0;
    222 
    223         foreach (var rowValue in x.Value) {
    224           matrix[c][r] = (T)rowValue;
     226        foreach (var callValue in x.Value) {
     227          matrix[c][r] = (T)callValue;
    225228          ++r;
    226229        }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs

    r17473 r17828  
    1212
    1313    public override Type ConvertableType => typeof(IResultParameter);
     14
     15    public override bool CanConvertType(Type t) =>
     16      t.GetInterfaces().Any(x => x == typeof(IResultParameter));
    1417
    1518    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17483 r17828  
    1212    public override Type ConvertableType => typeof(StringValue);
    1313
     14    public override bool CanConvertType(Type t) =>
     15      ConvertableType.IsAssignableFrom(t);
     16
    1417    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    1518      ((StringValue)item).Value = ((StringJsonItem)data).Value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17483 r17828  
    1010    public override int Priority => 4;
    1111    public override Type ConvertableType => typeof(IValueLookupParameter);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IValueLookupParameter));
    1215
    1316    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17519 r17828  
    1010    public override int Priority => 2;
    1111    public override Type ConvertableType => typeof(IValueParameter);
     12
     13    public override bool CanConvertType(Type t) =>
     14      t.GetInterfaces().Any(x => x == typeof(IValueParameter));
    1215
    1316    public override void Inject(IItem value, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs

    r17483 r17828  
    1414    public override int Priority => 1;
    1515    public override Type ConvertableType => typeof(IntRange);
     16
     17    public override bool CanConvertType(Type t) =>
     18      ConvertableType.IsAssignableFrom(t);
    1619
    1720    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942    public override Type ConvertableType => typeof(DoubleRange);
    4043
     44    public override bool CanConvertType(Type t) =>
     45      ConvertableType.IsAssignableFrom(t);
     46
    4147    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    4248      DoubleRange range = item as DoubleRange;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs

    r17477 r17828  
    1313    public override int Priority => 1;
    1414    public override Type ConvertableType => typeof(IntArray);
     15
     16    public override bool CanConvertType(Type t) =>
     17      ConvertableType.IsAssignableFrom(t);
    1518
    1619    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3942    public override Type ConvertableType => typeof(DoubleArray);
    4043
     44    public override bool CanConvertType(Type t) =>
     45      ConvertableType.IsAssignableFrom(t);
     46
    4147    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    4248      DoubleArray arr = item as DoubleArray;
     
    6369    public override int Priority => 2;
    6470    public override Type ConvertableType => typeof(PercentArray);
     71
     72    public override bool CanConvertType(Type t) =>
     73      ConvertableType.IsAssignableFrom(t);
    6574
    6675    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    8998    public override Type ConvertableType => typeof(BoolArray);
    9099
     100    public override bool CanConvertType(Type t) =>
     101      ConvertableType.IsAssignableFrom(t);
     102
    91103    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    92104      BoolArray arr = item as BoolArray;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs

    r17483 r17828  
    1212    public override int Priority => 1;
    1313    public override Type ConvertableType => typeof(IntMatrix);
     14
    1415    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    1516      IntMatrix mat = item as IntMatrix;
     
    9293    where T : struct
    9394  {
     95    public override bool CanConvertType(Type t) =>
     96      ConvertableType.IsAssignableFrom(t);
     97
    9498    #region Helper
     99    /// <summary>
     100    /// Copies the data into the matrix object. Uses reflection to set the
     101    /// row and column size of the matrix, because it is not possible to
     102    /// create a new matrix at this point and there exists no public resize method.
     103    /// </summary>
     104    /// <param name="matrix"></param>
     105    /// <param name="data"></param>
    95106    protected void CopyMatrixData(MatrixType matrix, T[][] data) {
    96107      var cols = data.Length;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs

    r17483 r17828  
    1212    public override int Priority => 1;
    1313    public override Type ConvertableType => typeof(IntValue);
     14
     15    public override bool CanConvertType(Type t) =>
     16      ConvertableType.IsAssignableFrom(t);
    1417
    1518    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    3033    public override Type ConvertableType => typeof(DoubleValue);
    3134
     35    public override bool CanConvertType(Type t) =>
     36      ConvertableType.IsAssignableFrom(t);
     37
    3238    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    3339      ((DoubleValue)item).Value = ((DoubleJsonItem)data).Value;
     
    4652    public override int Priority => 2;
    4753    public override Type ConvertableType => typeof(PercentValue);
     54
     55    public override bool CanConvertType(Type t) =>
     56      ConvertableType.IsAssignableFrom(t);
    4857
    4958    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    6473    public override Type ConvertableType => typeof(BoolValue);
    6574
     75    public override bool CanConvertType(Type t) =>
     76      ConvertableType.IsAssignableFrom(t);
     77
    6678    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    6779      ((BoolValue)item).Value = ((BoolJsonItem)data).Value;
     
    7991    public override Type ConvertableType => typeof(DateTimeValue);
    8092
     93    public override bool CanConvertType(Type t) =>
     94      ConvertableType.IsAssignableFrom(t);
     95
    8196    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
    8297      ((DateTimeValue)item).Value = ((DateTimeJsonItem)data).Value;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IConcreteRestrictedJsonItem.cs

    r17519 r17828  
    1 using System.Collections.Generic;
     1using System.Collections;
     2using System.Collections.Generic;
    23
    34namespace HeuristicLab.JsonInterface {
    45  public interface IConcreteRestrictedJsonItem<T> : IJsonItem {
    56    /// <summary>
    6     /// The item,
     7    /// array of restricted items
    78    /// </summary>
    89    IEnumerable<T> ConcreteRestrictedItems { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItemConverter.cs

    r17519 r17828  
    2929    /// </summary>
    3030    int Priority { get; }
     31
     32    /// <summary>
     33    /// Checks if the given type can be converted.
     34    /// </summary>
     35    /// <param name="t"></param>
     36    /// <returns></returns>
     37    bool CanConvertType(Type t);
    3138  }
    3239}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs

    r17540 r17828  
    2222
    2323    public Type ConvertableType => throw new NotImplementedException();
     24
     25    public bool CanConvertType(Type t) => throw new NotImplementedException();
    2426    #endregion
    2527
     
    3234      IList<IJsonItemConverter> possibleConverters = new List<IJsonItemConverter>();
    3335     
    34       foreach (var x in Converters)
    35         if (CompareTypes(type, x.Key))
     36      foreach (var x in Converters) {
     37        if (x.Value.CanConvertType(type))
    3638          possibleConverters.Add(x.Value);
     39      }
     40       
    3741
    3842      if(possibleConverters.Count > 0) {
     
    6165      else {
    6266        IJsonItemConverter converter = GetConverter(item.GetType());
    63         if (converter == null) return new UnsupportedJsonItem();
     67        if (converter == null)
     68          return new UnsupportedJsonItem() { Name = $"{item.ItemName} (unsupported)" };
    6469        IJsonItem tmp = converter.Extract(item, root);
    6570        ExtractCache.Add(hash, tmp);
     
    8489      Converters = converters;
    8590    }
    86 
    87     private bool CompareGenericTypes(Type t1, Type t2) =>
    88       (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) /*||
    89       (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1)*/;
    90 
    91     private bool CompareTypes(Type t1, Type t2) =>
    92       t1 == t2 || /*t1.IsAssignableFrom(t2) ||*/
    93       t1.GetInterfaces().Any(
    94         i => i == t2 || CompareGenericTypes(i, t2)
    95       ) ||
    96       CompareGenericTypes(t1, t2);
    9791  }
    9892}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs

    r17689 r17828  
    1212  public class JsonTemplateGenerator {
    1313
    14     public static void GenerateTemplate(string path, IOptimizer optimizer) =>
    15       GenerateTemplate(path, optimizer.Name, optimizer);
     14    /// <summary>
     15    /// static Function to generate a template.
     16    /// </summary>
     17    /// <param name="templatePath">the path for the template files</param>
     18    /// <param name="optimizer">the optimizer object to serialize</param>
     19    /// <param name="rootItem">Root JsonItem for serialization, considers only active JsonItems for serialization</param>
     20    public static void GenerateTemplate(string templatePath, IOptimizer optimizer, IJsonItem rootItem) {
     21      // clear all runs
     22      optimizer.Runs.Clear();
    1623
    17     public static void GenerateTemplate(string path, string templateName, IOptimizer optimizer) =>
    18       GenerateTemplate(path, templateName, optimizer, JsonItemConverter.Extract(optimizer));
     24      // validation
     25      ValidationResult validationResult = rootItem.GetValidator().Validate();
     26      if (!validationResult.Success)
     27        throw validationResult.GenerateException();
    1928
    20     public static void GenerateTemplate(string path, string templateName, IOptimizer optimizer, IJsonItem rootItem) {
    2129      #region Init
    2230      JObject template = JObject.Parse(Constants.Template);
     
    2432      JArray resultItems = new JArray();
    2533      IList<IJsonItem> jsonItems = new List<IJsonItem>();
    26       string fullPath = Path.GetFullPath(path);
     34      string templateName = Path.GetFileName(templatePath);
     35      string templateDirectory = Path.GetDirectoryName(templatePath);
     36
    2737      #endregion
    2838
     
    3545      #region Serialize HL File
    3646      ProtoBufSerializer serializer = new ProtoBufSerializer();
    37       string hlFilePath = Path.Combine(fullPath, templateName + ".hl");
     47      string hlFilePath = Path.Combine(templateDirectory, $"{templateName}.hl");
    3848      serializer.Serialize(optimizer, hlFilePath);
    3949      #endregion
     
    5666
    5767      #region Serialize and write to file
    58       File.WriteAllText(fullPath + @"\" + templateName + ".json", SingleLineArrayJsonWriter.Serialize(template));
     68      File.WriteAllText(Path.Combine(templateDirectory, $"{templateName}.json"), SingleLineArrayJsonWriter.Serialize(template));
    5969      #endregion
    6070    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r17560 r17828  
    1 using System.Collections.Generic;
     1using System;
     2using System.Collections.Generic;
    23using System.IO;
    34using System.Linq;
     
    6667      IJsonItem rootItem = Objects.First().Value;
    6768
    68       //TODO validate
     69      // validation
     70      ValidationResult validationResult = rootItem.GetValidator().Validate();
     71      if (!validationResult.Success)
     72        throw validationResult.GenerateException();
    6973
    7074      // inject configuration
     
    105109        if (Objects.TryGetValue(path, out IJsonItem param)) {
    106110          // remove fixed template parameter from config => dont allow to copy them from concrete config
     111          // TODO: shift this into JsonItems?
    107112          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Minimum))?.Remove();
    108113          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Maximum))?.Remove();
    109114          obj.Property(nameof(IConcreteRestrictedJsonItem<string>.ConcreteRestrictedItems))?.Remove();
     115          obj.Property(nameof(IMatrixJsonItem.ColumnsResizable))?.Remove();
     116          obj.Property(nameof(IMatrixJsonItem.RowsResizable))?.Remove();
     117          obj.Property(nameof(IArrayJsonItem.Resizable))?.Remove();
    110118          // merge
    111119          param.SetJObject(obj);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ConcreteRestrictedValueJsonItem.cs

    r17519 r17828  
    1 using System.Collections.Generic;
     1using System.Collections;
     2using System.Collections.Generic;
    23using System.Linq;
    34
    45namespace HeuristicLab.JsonInterface {
     6
    57  public abstract class ConcreteRestrictedValueJsonItem<T> : ValueJsonItem<T>, IConcreteRestrictedJsonItem<T> {
     8
    69    public IEnumerable<T> ConcreteRestrictedItems { get; set; }
    710
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/IntervalRestrictedValueJsonItem.cs

    r17519 r17828  
    2020      if (minProp != null) Minimum = minProp.ToObject<T>();
    2121
    22 
    2322      var maxProp = jObject[nameof(IIntervalRestrictedJsonItem<T>.Maximum)];
    2423      if (maxProp != null) Maximum = maxProp.ToObject<T>();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/JsonItem.cs

    r17519 r17828  
    1 using System.Collections;
     1using System;
     2using System.Collections;
    23using System.Collections.Generic;
    34using System.Linq;
     
    2627    public bool Success { get; }
    2728    public IEnumerable<string> Errors { get; }
     29
     30    public Exception GenerateException() =>
     31      new AggregateException(Errors.Select(x => new ArgumentException(x)));
    2832  }
    2933
     
    7680    }
    7781
    78     // TODO jsonIgnore dataType?
    7982    [JsonIgnore]
    8083    public virtual IEnumerable<IJsonItem> Children { get; protected set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ResultJsonItem.cs

    r17519 r17828  
    22  public class ResultJsonItem : JsonItem, IResultJsonItem {
    33    protected override ValidationResult Validate() => ValidationResult.Successful();
     4
     5    public string Converter { get; set; }
    46  }
    57}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/UnsupportedJsonItem.cs

    r17519 r17828  
    11using System;
    22using System.Collections.Generic;
     3using System.Linq;
    34using Newtonsoft.Json;
    45
    56namespace HeuristicLab.JsonInterface {
    67  public class UnsupportedJsonItem : JsonItem {
     8    /*
    79    public override string Name {
    810      get => throw new NotSupportedException();
     
    1012    }
    1113
    12     public override string Description {
     14    public override string Description { // TODO
    1315      get => throw new NotSupportedException();
    1416      set => throw new NotSupportedException();
     
    1820      get => throw new NotSupportedException();
    1921    }
     22    */
    2023
    2124    [JsonIgnore]
    2225    public override IEnumerable<IJsonItem> Children {
    23       get => throw new NotSupportedException();
     26      get => Enumerable.Empty<IJsonItem>();
    2427      protected set => throw new NotSupportedException();
    2528    }
    26 
     29    /*
    2730    [JsonIgnore]
    2831    public override IJsonItem Parent {
     
    3033      set => throw new NotSupportedException();
    3134    }
    32 
     35    */
    3336    protected override ValidationResult Validate() => ValidationResult.Successful();
    3437  }
Note: See TracChangeset for help on using the changeset viewer.