public void loadDataInGui() { AstTypeTreeView.clear(); AstValueTreeView.clear(); iNodesByType = AstData.iNodes_By_Type(INodeTypeFilter); foreach (var item in iNodesByType) { var nodeText = "{0} ({1})".format(item.Key, item.Value.size()); AstTypeTreeView.add_Node(nodeText, item.Value); } AstTypeTreeView.selectFirst(); }
public void showINodes(List <INode> iNodes) { if (iNodes == null) { if (AstTypeTreeView.selected() == null) { return; } else { iNodes = (List <INode>)AstTypeTreeView.selected().tag <List <INode> >(); } } AstValueTreeView.backColor(Color.Azure); //AstValueTreeView.visible(false); AstValueTreeView.clear(); O2Thread.mtaThread( () => { var notResolvedText = " ____INODE Text not resolved"; var indexedData = new Dictionary <string, List <INode> >(); foreach (var iNode in iNodes) { var value = notResolvedText; if (PublicDI.reflection.getPropertyInfo("Value", iNode.type()).notNull()) { value = iNode.property("Value").str(); } if (PublicDI.reflection.getPropertyInfo("Name", iNode.type()).notNull()) { value = iNode.property("Name").str(); } else if (PublicDI.reflection.getPropertyInfo("Identifier", iNode.type()).notNull()) { value = iNode.property("Identifier").str(); } else if (PublicDI.reflection.getPropertyInfo("MemberName", iNode.type()).notNull()) { value = iNode.property("MemberName").str(); } else if (PublicDI.reflection.getPropertyInfo("ParameterName", iNode.type()).notNull()) { value = iNode.property("ParameterName").str(); } if (value == notResolvedText) { if (iNode.str().regEx(INodeValueFilter)) { indexedData.add(notResolvedText, iNode); } } else if (value.regEx(INodeValueFilter)) { indexedData.add(value.trim(), iNode); } } AstValueTreeView.add_Nodes(indexedData, 1000, TopProgressBar); AstValueTreeView.backColor(Color.White); AstValueTreeView.selectFirst(); return; //var indexedData = iNodes.indexOnToString(INodeValueFilter); ; //getTextForINode /*var typeName = iNodes[0].typeName(); * var rootNode = AstValueTreeView.add_Node(typeName, null); * rootNode.add_Nodes(indexedData, 1000, TopProgressBar); * AstValueTreeView.visible(true); * if (AstValueTreeView.nodes().size() > 0 && AstValueTreeView.nodes()[0].nodes().size() >0 ) * AstValueTreeView.nodes()[0].nodes()[0].selected(); * rootNode.expand(); */ }); }