O2 .NET AST Engine/Call Graph Script Examples
From
Contents |
This wiki page contains the script examples used inside the O2 .NET AST Engine
set node text to '*'
foreach(WPF.Label node in graph.nodes()) node.set_Text_Wpf("*");
color all nodes Black
foreach(WPF.Label node in graph.nodes()) node.color("Black");
set node font size to 4
foreach(WPF.Label node in graph.nodes()) node.fontSize(4);
Highlight all .NET WebServices Methods
foreach(WPF.Label node in graph.nodes()) { var methodSignature = node.get_Tag<string>(); var methodDeclaration = astData.methodDeclaration_withSignature(methodSignature); if (methodDeclaration != null) if (methodDeclaration.attributes().name("WebMethod")!=null) node.color("Blue").fontSize(10); }
Highlight System.Data.SqlClientMethods
foreach(WPF.Label node in graph.nodes()) { var methodSignature = node.get_Tag<string>(); if (methodSignature.regEx("System.Data.SqlClient.*string")) node.color("Red").fontSize(10); }
