c# - SyntaxWalker Visit method -
i have problem class syntaxwalker , method:
visitmemberaccessexpression(memberaccessexpressionsyntax node)
i node type , if equal example: "person" add list. use:
if(semanticmodel.gettypeinfo(node).type.name == modelname) list.add("stack");
but have error: "object reference not set instance of object" why? fields:
private isemanticmodel semanticmodel; public string modelname { get; private set; }
set model name:
modelname = type.basetype.typearguments[0].name.tostring();
i've been on few days , not know please please. in accordance advice: how define "node" type in roslyn?
Comments
Post a Comment