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="array">The <see cref="Array" /> property of the result.</param>
        /// <param name="indexes">The <see cref="Indexes" /> property of the result.</param>
        /// <returns>This expression if no children changed, or an expression with the updated children.</returns>
        public ConditionalArrayIndexCSharpExpression Update(Expression array, IEnumerable <Expression> indexes)
        {
            if (array == Array && indexes == Indexes)
            {
                return(this);
            }

            return(CSharpExpression.ConditionalArrayIndex(array, indexes));
        }