コード例 #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="locals">The <see cref="Locals" /> property of the result.</param>
        /// <param name="labels">The <see cref="Labels" /> property of the result.</param>
        /// <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 SwitchSection Update(IEnumerable <ParameterExpression> locals, IEnumerable <SwitchLabel> labels, IEnumerable <Expression> statements)
        {
            if (SameElements(ref locals, Locals) && SameElements(ref labels, Labels) && SameElements(ref statements, Statements))
            {
                return(this);
            }

            return(CSharpExpression.SwitchSection(locals, labels, statements));
        }