public static void ComputeRefactorings(RefactoringContext context, AnonymousMethodExpressionSyntax anonymousMethod) { if (context.IsRefactoringEnabled(RefactoringIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod) && UseLambdaExpressionInsteadOfAnonymousMethodAnalysis.IsFixable(anonymousMethod)) { context.RegisterRefactoring( "Use lambda expression instead of anonymous method", ct => UseLambdaExpressionInsteadOfAnonymousMethodRefactoring.RefactorAsync(context.Document, anonymousMethod, ct)); } }
public static void ComputeRefactorings(RefactoringContext context, AnonymousMethodExpressionSyntax anonymousMethod) { if (context.IsRefactoringEnabled(RefactoringIdentifiers.UseLambdaExpressionInsteadOfAnonymousMethod) && UseLambdaExpressionInsteadOfAnonymousMethodRefactoring.CanRefactor(anonymousMethod)) { context.RegisterRefactoring( "Use lambda expression instead of anonymous method", cancellationToken => { return(UseLambdaExpressionInsteadOfAnonymousMethodRefactoring.RefactorAsync( context.Document, anonymousMethod, cancellationToken)); }); } }