System.Linq.Expressions.GotoExpression.Update C# (CSharp) Méthode

Update() public méthode

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.
public Update ( LabelTarget target, Expression value ) : GotoExpression
target LabelTarget The property of the result.
value Expression The property of the result.
Résultat GotoExpression
        public GotoExpression Update(LabelTarget target, Expression value)
        {
            if (target == Target && value == Value)
            {
                return this;
            }
            return Expression.MakeGoto(Kind, target, value, Type);
        }
    }

Usage Example

        /// <summary>
        ///     Visits the children of the <see cref="GotoExpression" />.
        /// </summary>
        /// <param name="node">The expression to visit.</param>
        /// <returns>
        ///     The modified expression, if it or any subexpression was modified;
        ///     otherwise, returns the original expression.
        /// </returns>
        protected internal virtual Expression VisitGoto(GotoExpression node)
        {
            if (node == null)
            {
                throw new ArgumentNullException(nameof(node));
            }

            return(node.Update(VisitLabelTarget(node.Target), Visit(node.Value)));
        }
All Usage Examples Of System.Linq.Expressions.GotoExpression::Update