Exemplo n.º 1
0
        protected internal override ExpressionSlim VisitTry(TryExpressionSlim node)
        {
            Append("Try(");
            Visit(node.Body);
            if (node.Handlers.Count > 0)
            {
                Append(", ");
                Visit(", ", node.Handlers, VisitCatchBlock);
            }
            VisitNonNull(", ", node.Finally);
            VisitNonNull(", ", node.Fault);
            Append(')');

            return(node);
        }
 /// <summary>
 /// Visits a try expression slim tree node, produces a try expression.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <param name="body">Body expression.</param>
 /// <param name="finally">Finally expression.</param>
 /// <param name="fault">Fault expression.</param>
 /// <param name="handlers">Handler expressions.</param>
 /// <returns>The try expression represented by the expression slim node.</returns>
 protected override Expression MakeTry(TryExpressionSlim node, Expression body, Expression @finally, Expression fault, ReadOnlyCollection <CatchBlock> handlers)
 {
     return(_factory.MakeTry(VisitIfNotNull(node.Type, MakeTypeCachedDelegate), body, @finally, fault, handlers));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Visits a try expression tree node.
 /// </summary>
 /// <param name="node">Node to visit.</param>
 /// <returns>Result of visiting the node.</returns>
 protected internal virtual ExpressionSlim VisitTry(TryExpressionSlim node)
 {
     return(node.Update(Visit(node.Body), Visit(node.Handlers, VisitCatchBlock), Visit(node.Finally), Visit(node.Fault)));
 }