Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs @ 17519

Last change on this file since 17519 was 17519, checked in by dpiringe, 4 years ago

#3026:

  • added error output for failed runner initialization
  • reorganised some final view models
  • TargetedJsonItemType (in JsonItemVMBase) now automatically returns the type of the defined JsonItem
  • code cleanup
  • refactored RegressionProblemDataConverter
  • added lots of comments
  • added new view for StringArrayJsonItem
  • added new UI component for concrete restricted items and used it in JsonItemConcreteItemArrayControl and JsonItemValidValuesControl
File size: 2.5 KB
Line 
1using System;
2using System.Collections;
3using System.Collections.Generic;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using Newtonsoft.Json;
8using Newtonsoft.Json.Linq;
9
10namespace HeuristicLab.JsonInterface {
11  [JsonObject]
12  public interface IJsonItem : IEnumerable<IJsonItem> {
13    /// <summary>
14    /// Only active items are included in templates.
15    /// </summary>
16    bool Active { get; set; }
17
18    /// <summary>
19    /// The name of the JsonItem. Can be changed freely after fixating the path.
20    /// If the path is not fix, changing the name will have affect of the path.
21    /// </summary>
22    string Name { get; set; }
23
24    /// <summary>
25    /// A description for the JsonItem.
26    /// </summary>
27    string Description { get; set; }
28
29    /// <summary>
30    /// The JsonItem path in the related object graph.
31    /// </summary>
32    string Path { get; }
33
34    /// <summary>
35    /// IEnumerable of all sub JsonItems.
36    /// </summary>
37    [JsonIgnore]
38    IEnumerable<IJsonItem> Children { get; }
39
40    /// <summary>
41    /// If the JsonItem is a children of an other JsonItem, the parent will be this other JsonItem.
42    /// </summary>
43    [JsonIgnore]
44    IJsonItem Parent { get; set; }
45
46    /// <summary>
47    /// Returns a validator with integrated caching to validate the JsonItem and all children.
48    /// </summary>
49    /// <returns>JsonItemValidator</returns>   
50    IJsonItemValidator GetValidator();
51
52    /// <summary>
53    /// Add sub JsonItems.
54    /// </summary>
55    /// <param name="childs"></param>
56    void AddChildren(params IJsonItem[] childs);
57    void AddChildren(IEnumerable<IJsonItem> childs);
58
59    /// <summary>
60    /// This method fixates the path.
61    /// After calling, the path cannot be changed by changing the name or parent.
62    /// </summary>
63    void FixatePath();
64
65    /// <summary>
66    /// This method looses the path again after a call of FixatePath.
67    /// After calling, the path is calculated by the position in item tree again.
68    /// </summary>
69    void LoosenPath();
70
71    /// <summary>
72    /// Method to generate a Newtonsoft JObject, which describes the JsonItem.
73    /// </summary>
74    /// <returns>Newtonsoft JObject</returns>
75    JObject GenerateJObject();
76
77    /// <summary>
78    /// To set all necessary JsonItem properties with an given Newtonsoft JObject.
79    /// </summary>
80    /// <param name="jObject">Newtonsoft JObject</param>
81    void SetJObject(JObject jObject);
82  }
83}
Note: See TracBrowser for help on using the repository browser.