System.Linq.Expressions.CatchBlock.Update C# (CSharp) Метод

Update() публичный Метод

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 ( System.Linq.Expressions.ParameterExpression variable, Expression filter, Expression body ) : CatchBlock
variable System.Linq.Expressions.ParameterExpression The property of the result.
filter Expression The property of the result.
body Expression The property of the result.
Результат CatchBlock
        public CatchBlock Update(ParameterExpression variable, Expression filter, Expression body)
        {
            if (variable == Variable && filter == Filter && body == Body)
            {
                return this;
            }
            return Expression.MakeCatchBlock(Test, variable, body, filter);
        }
    }

Usage Example

Пример #1
0
            protected override CatchBlock VisitCatchBlock(CatchBlock node)
            {
                if (node.Variable != null)
                {
                    _environment.Push(new[] { node.Variable });
                }

                //
                // Just visit children to perform inlining of constants or defaults. Note that the parent
                // try expression requires that non-trivial bindings are satisfied by the protected region
                // so we don't have to worry about that over here.
                //

                var filter = Visit(node.Filter);
                var body   = Visit(node.Body);

                if (node.Variable != null)
                {
                    _environment.Pop();
                }

                return(node.Update(node.Variable, filter, body));
            }
All Usage Examples Of System.Linq.Expressions.CatchBlock::Update