Exemplo n.º 1
0
        public static bool TryCreate(
            BinaryExpressionSyntax binaryExpression,
            out BinaryExpressionChain result)
        {
            List <ExpressionSyntax> expressions = GetExpressions(binaryExpression, binaryExpression.Kind());

            if (expressions != null)
            {
                expressions.Reverse();
                result = new BinaryExpressionChain(binaryExpression, expressions);
                return(true);
            }

            result = default(BinaryExpressionChain);
            return(false);
        }
Exemplo n.º 2
0
        public static bool TryCreate(
            SyntaxNode node,
            SyntaxKind binaryExpressionKind,
            out BinaryExpressionChain result)
        {
            var binaryExpression = node as BinaryExpressionSyntax;

            if (binaryExpression?.Kind() == binaryExpressionKind)
            {
                List <ExpressionSyntax> expressions = GetExpressions(binaryExpression, binaryExpressionKind);

                if (expressions != null)
                {
                    expressions.Reverse();
                    result = new BinaryExpressionChain(binaryExpression, expressions);
                    return(true);
                }
            }

            result = default(BinaryExpressionChain);
            return(false);
        }