c# - How to obtain parameters from a statement in Roslyn to variable -
so far i've been able find console.writeline("hello world") statement inside method.body. want collect "hello world" string writeline("hello world"); statement. how can this? code:
methoddeclarationsyntax method = syntaxtree.getroot() .descendantnodes() .oftype<methoddeclarationsyntax>() .first(); blocksyntax statement = method.body; controlflowanalysis controlflow = semanticmodel.analyzecontrolflow(statement); statementsyntax state = statement.statements.first(); console.writeline(state.tostring()); console.readline();
Comments
Post a Comment