public override Expression <TDelegate> ToLambda() { Method method = null; ICecilArgumentsResolver typeResolver = null; NRefactory.MethodDeclaration methodDeclaration = null; var genericTypesTransformerVisitor = new GenericTypesTransformerVisitor(); var lambdaExpressionVisitor = new LambdaExpressionVisitor <NRefactory.MethodDeclaration>(); MethodDefinition methodDefinition = _methodInfo.ResolveMethodDefinition(); if (methodDefinition.HasGenericParameters) { var types = _methodInfo.GetGenericArguments(); typeResolver = new MethodDefinitionTypesResolver(methodDefinition, types); } else { typeResolver = DummyArgumentsResolver.Instance; } methodDeclaration = methodDefinition.ResolveMothod <NRefactory.MethodDeclaration>(); methodDeclaration = methodDeclaration.AcceptVisitor(typeResolver, genericTypesTransformerVisitor); methodDeclaration = methodDeclaration.AcceptVisitor(lambdaExpressionVisitor); method = AstExpression.Method(methodDeclaration, Context, new NRefactoryAstVisitor()); return(Expression.Lambda <TDelegate>(method, method.Parameters)); }
public static Method Method(NRefactory.MethodDeclaration methodDeclaration, object context, INRefcatoryExpressionVisitor visitor, IScope scope = null) { Method methodBlock = null; if (!methodDeclaration.IsCompilerGeneratorEnumerator(ref methodBlock)) { methodBlock = new MethodDeclaration(methodDeclaration, context, scope, visitor); } return(methodBlock); }
public bool CheckMethod(ICS.MethodDeclaration node, InspectionData data) { if ((MatchKind != 0 && (MatchKind & DeclarationKinds.Method) == 0) || !CheckAttributedNode(node, ICS.Modifiers.Private)) { return(false); } string name = node.Name; if (IsValid(name)) { return(true); } data.Add(GetFixableResult(node.NameToken.StartLocation, null, name)); return(true); }
public virtual S VisitMethodDeclaration(MethodDeclaration methodDeclaration, T data) { return(VisitChildren(methodDeclaration, data)); }
void IAstVisitor.VisitMethodDeclaration(MethodDeclaration methodDeclaration) { Visit(EnterMethodDeclaration, LeaveMethodDeclaration, methodDeclaration); }
public override void VisitMethodDeclaration(ICSharpCode.NRefactory.CSharp.MethodDeclaration methodDeclaration) { base.VisitMethodDeclaration(methodDeclaration); AddMethod(methodDeclaration, methodDeclaration.Body); }
public virtual S VisitMethodDeclaration(MethodDeclaration methodDeclaration, T data) { throw new NotImplementedException(); }
public override AstExpression VisitMethodDeclaration(NRefactory.MethodDeclaration methodDeclaration, IScope scope) { throw new NotImplementedException(); }