Пример #1
0
        public static void ComputeRefactoring(RefactoringContext context, IfStatementSyntax ifStatement)
        {
            SimpleIfElseInfo simpleIfElse = SyntaxInfo.SimpleIfElseInfo(ifStatement);

            if (!simpleIfElse.Success)
            {
                return;
            }

            context.RegisterRefactoring(
                "Swap if-else",
                cancellationToken => RefactorAsync(context.Document, ifStatement, cancellationToken));
        }