Example #1
0
        public Task <SyntaxNode> ProcessAsync(Document document, SyntaxNode syntaxRoot, CancellationToken cancellationToken)
        {
            SyntaxNode result;

            switch (document.Project.Language)
            {
            case LanguageNames.CSharp:
            {
                var rewriter = new CSharpVisibilityRewriter(document, cancellationToken);
                result = rewriter.Visit(syntaxRoot);
                break;
            }

            case LanguageNames.VisualBasic:
            {
                var rewriter = new VisualBasicVisibilityRewriter(document, cancellationToken);
                result = rewriter.Visit(syntaxRoot);
                break;
            }

            default:
                throw new NotSupportedException();
            }

            return(Task.FromResult(result));
        }
        public Task<SyntaxNode> ProcessAsync(Document document, SyntaxNode syntaxRoot, CancellationToken cancellationToken)
        {
            SyntaxNode result;
            switch (document.Project.Language)
            {
                case LanguageNames.CSharp:
                    {
                        var rewriter = new CSharpVisibilityRewriter(document, cancellationToken);
                        result = rewriter.Visit(syntaxRoot);
                        break;
                    }
                case LanguageNames.VisualBasic:
                    {
                        var rewriter = new VisualBasicVisibilityRewriter(document, cancellationToken);
                        result = rewriter.Visit(syntaxRoot);
                        break;
                    }
                default:
                    throw new NotSupportedException();
            }

            return Task.FromResult(result);
        }