public static Task <Document> RefactorAsync( Document document, LockStatementSyntax lockStatement, CancellationToken cancellationToken = default(CancellationToken)) { return(IntroduceFieldToLockOnRefactoring.RefactorAsync(document, lockStatement, cancellationToken)); }
public static async Task <Document> RefactorAsync( Document document, LockStatementSyntax lockStatement, CancellationToken cancellationToken = default(CancellationToken)) { return(await IntroduceFieldToLockOnRefactoring.RefactorAsync(document, lockStatement, cancellationToken).ConfigureAwait(false)); }
public static void ComputeRefactorings(RefactoringContext context, LockStatementSyntax lockStatement) { if (context.IsRefactoringEnabled(RefactoringIdentifiers.IntroduceFieldToLockOn)) { ExpressionSyntax expression = lockStatement.Expression; if (expression != null) { if (expression.IsMissing || expression.IsKind(SyntaxKind.ThisExpression)) { if (context.Span.IsContainedInSpanOrBetweenSpans(expression)) { context.RegisterRefactoring( "Introduce field to lock on", cancellationToken => IntroduceFieldToLockOnRefactoring.RefactorAsync(context.Document, lockStatement, cancellationToken)); } } } } }