Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/21/20 17:14:46 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • added a new way to setup the targeted result types
  • added new ui controls: NumericRangeControl, JsonItemArrayControl, JsonItemDefaultControl
  • redesigned export dialog -> now the user can navigate with a tree view
  • enhanced JsonItemVM
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVM.cs

    r17404 r17405  
    77
    88namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     9  public delegate void OnSelectionChangeHandler(JsonItemVM sender, bool selection);
     10  public delegate void OnChildAddedHandler(JsonItemVM sender, JsonItemVM child);
     11
    912  public class JsonItemVM {
    1013    public JsonItem Item { get; set; }
    1114
    12     public bool Selected { get; set; } = true;
     15    private IList<JsonItemVM> children = new List<JsonItemVM>();
     16    public IEnumerable<JsonItemVM> Children {
     17      get => children;
     18    }
     19
     20    public JsonItemVM Parent { get; set; }
     21
     22    private bool selected = true;
     23    public bool Selected {
     24      get => selected;
     25      set {
     26        selected = value;
     27        OnSelectionChange?.Invoke(this, Selected);
     28      }
     29    }
     30
     31    public event OnSelectionChangeHandler OnSelectionChange;
     32    public event OnChildAddedHandler OnChildAdded;
    1333
    1434    public JsonItemVM(JsonItem item) {
    1535      this.Item = item;
    1636    }
     37
     38    public void AddChild(JsonItemVM vm) {
     39      children.Add(vm);
     40      vm.Parent = this;
     41      OnChildAdded?.Invoke(this, vm);
     42    }
    1743  }
    1844}
Note: See TracChangeset for help on using the changeset viewer.