public static SyntaxToken GetOpenToken(this BaseArgumentListSyntax node)
        {
            if (node != null)
            {
                switch (node.Kind())
                {
                case SyntaxKind.ArgumentList:
                    return(((ArgumentListSyntax)node).OpenParenToken);

                case SyntaxKind.BracketedArgumentList:
                    return(((BracketedArgumentListSyntax)node).OpenBracketToken);
                }
            }

            return(default);
Exemplo n.º 2
0
        public static BaseArgumentListSyntax WithArguments(
            this BaseArgumentListSyntax node, SeparatedSyntaxList <ArgumentSyntax> arguments)
        {
            switch (node.Kind())
            {
            case SyntaxKind.ArgumentList:
                return(((ArgumentListSyntax)node).WithArguments(arguments));

            case SyntaxKind.BracketedArgumentList:
                return(((BracketedArgumentListSyntax)node).WithArguments(arguments));

            default:
                throw new InvalidOperationException();
            }
        }