public bool TryResolveMethodInfo( MethodDeclarationSyntax node, out MethodInfo result) { result = null; var resolver = new ResolveUsingsAndNamespacesVisitor(); resolver.Visit(node); return(Context.Library.TryResolveMethod(resolver.Namespaces.Concat(new[] { node.Identifier.ValueText }), out result)); }
public bool TryResolveMethodInfo( InvocationExpressionSyntax node, out MethodInfo result) { result = null; var resolver = new ResolveUsingsAndNamespacesVisitor(); resolver.Visit(node); switch (node.Expression) { case IdentifierNameSyntax ins: // simple invocation like method() on current code block return(Context.Library.TryResolveMethod(resolver.Namespaces.Concat(new[] { ins.Identifier.ValueText }), out result)); } return(false); }