public static O2MappedAstData showInTreeView(this O2MappedAstData o2MappedAstData, System.Windows.Forms.TreeView treeView, SourceCodeEditor codeEditor) { o2MappedAstData.afterSelect_ShowInSourceCodeEditor(treeView, codeEditor); return(o2MappedAstData.showInTreeView(treeView)); }
public static T view_AstNodes_SourceCode_Locations <T>(this O2MappedAstData astData, List <AbstractNode> astNodes, T control) where T : Control { var codeViewer = control.add_SourceCodeViewer(); var treeView = codeViewer.insert_Left <Panel>(400).add_TreeView().sort(); astData.afterSelect_ShowInSourceCodeEditor(treeView, codeViewer.editor()); foreach (var astNode in astNodes) { treeView.add_Node("{0} - {1}".format(astData.getTextForINode(astNode), astNode), astNode); } treeView.selectFirst(); return(control); }
public static TreeView getTreeViewToShowMethodsMappings(this O2MappedAstData astData, Control control, ascx_SourceCodeViewer sourceCodeViewer) { // create GUI control.clear(); var treeView = control.add_TreeView() .showSelection() .sort(); astData.afterSelect_ShowInSourceCodeEditor(treeView, sourceCodeViewer.editor()); treeView.afterSelect <IMethod>( (iMethod) => { var methodDeclaration = astData.MapAstToNRefactory.IMethodToMethodDeclaration[iMethod]; sourceCodeViewer.set_Text(methodDeclaration.csharpCode()); }); return(treeView); }