Example #1
0
        /// <summary>
        /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
        /// </summary>
        /// <param name="statements">The <see cref="Statements" /> property of the result.</param>
        /// <returns>This expression if no children changed, or an expression with the updated children.</returns>
        public CSharpSwitchCase Update(IEnumerable <Expression> statements)
        {
            if (SameElements(ref statements, Statements))
            {
                return(this);
            }

            return(CSharpExpression.SwitchCase(TestValues, statements));
        }
Example #2
0
        /// <summary>
        /// Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression.
        /// </summary>
        /// <param name="statements">The <see cref="Statements" /> property of the result.</param>
        /// <returns>This expression if no children changed, or an expression with the updated children.</returns>
        public CSharpSwitchCase Update(IEnumerable <Expression> statements)
        {
            if (statements == this.Statements)
            {
                return(this);
            }

            return(CSharpExpression.SwitchCase(TestValues, statements));
        }