Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/09/20 10:36:09 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • deleted INamedMatrixJsonItem and all corresponding classes/views, because of bad design
  • added ILookupJsonItem and IValueLookupJsonItem (incl. all corresponding implementations, VMs, Views)
  • added IResultJsonItem
  • changed type of property Control from JsonItemBaseControl to UserControl in IJsonItemVM (because the details control now builds up with linked user controls -> allows better construction of dynamic controls)
  • added all properties of INamedMatrixJsonItem in IMatrixJsonItem
  • refactored a lot of views for better usage (TableLayoutPanel is used a lot now -> for better item positioning)
  • property ActualName is now located in ILookupJsonItem instead of IJsonItem
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17453 r17471  
    5151    private void InitCache() {
    5252      JI2VM = new Dictionary<Type, Type>();
    53       foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(JsonItemVMBase))) {
    54         JsonItemVMBase vm = (JsonItemVMBase)Activator.CreateInstance(vmType);
     53      foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
     54        IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    5555        JI2VM.Add(vm.JsonItemType, vmType);
    5656      }
     
    9696        foreach (var c in item.Children) {
    9797          if (IsDrawableItem(c)) {
    98             if (c is ResultJsonItem) {
     98            if (c is IResultJsonItem) {
    9999              TreeNode childNode = new TreeNode(c.Name);
    100100              treeViewResults.Nodes.Add(childNode);
     
    113113
    114114    private void RegisterItem(TreeNode node, IJsonItem item, TreeView tv) {
    115       if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) {
     115      if (JI2VM.TryGetValue(item.GetType(), out Type vmType)) { // TODO: enhance for interfaces?
    116116        IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    117117
     
    123123        VMs.Add(vm);
    124124        Node2VM.Add(node, vm);
    125         UserControl control = vm.Control;
     125        UserControl control = new JsonItemBaseControl(vm, vm.Control);
    126126        Node2Control.Add(node, control);
     127      } else {
     128        //node.
    127129      }
    128130    }
     
    136138      }
    137139     
    138       return b || (item.Value != null || item.Range != null || item.ActualName != null || item is ResultJsonItem);
     140      return b || (item.Value != null || item.Range != null || item is ILookupJsonItem || item is IResultJsonItem);
    139141    }
    140142   
Note: See TracChangeset for help on using the changeset viewer.