Changeset 17471 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
- Timestamp:
- 03/09/20 10:36:09 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17453 r17471 51 51 private void InitCache() { 52 52 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); 55 55 JI2VM.Add(vm.JsonItemType, vmType); 56 56 } … … 96 96 foreach (var c in item.Children) { 97 97 if (IsDrawableItem(c)) { 98 if (c is ResultJsonItem) {98 if (c is IResultJsonItem) { 99 99 TreeNode childNode = new TreeNode(c.Name); 100 100 treeViewResults.Nodes.Add(childNode); … … 113 113 114 114 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? 116 116 IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType); 117 117 … … 123 123 VMs.Add(vm); 124 124 Node2VM.Add(node, vm); 125 UserControl control = vm.Control;125 UserControl control = new JsonItemBaseControl(vm, vm.Control); 126 126 Node2Control.Add(node, control); 127 } else { 128 //node. 127 129 } 128 130 } … … 136 138 } 137 139 138 return b || (item.Value != null || item.Range != null || item .ActualName != null || item isResultJsonItem);140 return b || (item.Value != null || item.Range != null || item is ILookupJsonItem || item is IResultJsonItem); 139 141 } 140 142
Note: See TracChangeset
for help on using the changeset viewer.