source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItemConverter.cs @ 17828

Last change on this file since 17828 was 17828, checked in by dpiringe, 2 months ago

#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)
File size: 1.2 KB
Line 
1using System;
2using HeuristicLab.Core;
3
4namespace HeuristicLab.JsonInterface {
5  public interface IJsonItemConverter {
6    /// <summary>
7    /// Injects the saved infos from the JsonItem into the IItem.
8    /// (Sets the necessary values.)
9    /// </summary>
10    /// <param name="item">The IItem which get the data injected.</param>
11    /// <param name="data">The JsonItem with the saved values.</param>
12    void Inject(IItem item, IJsonItem data, IJsonItemConverter root);
13
14    /// <summary>
15    /// Extracts all infos out of an IItem to create a JsonItem.
16    /// (For template generation.)
17    /// </summary>
18    /// <param name="value">The IItem to extract infos.</param>
19    /// <returns>JsonItem with infos to reinitialise the IItem.</returns>
20    IJsonItem Extract(IItem value, IJsonItemConverter root);
21
22    /// <summary>
23    /// The targeted type for the converter.
24    /// </summary>
25    Type ConvertableType { get; }
26
27    /// <summary>
28    /// A given priority, higher numbers are prior.
29    /// </summary>
30    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);
38  }
39}
40
Note: See TracBrowser for help on using the repository browser.