Exemplo n.º 1
0
 public static TryStatement ToStatement(TryStatementBuilder builder)
 {
     Contract.RequiresNotNull(builder, "builder");
     return(new TryStatement(
                builder._statementSpan,
                builder._header,
                builder._tryStatement,
                (builder._catchBlocks != null) ? CollectionUtils.ToReadOnlyCollection(builder._catchBlocks.ToArray()) : null,
                builder._finallyStatement
                ));
 }
Exemplo n.º 2
0
        public static Expression ToStatement(TryStatementBuilder builder)
        {
            ContractUtils.RequiresNotNull(builder, "builder");
            var result = Expression.MakeTry(
                builder._try,
                builder._finally,
                builder._fault,
                builder._catchBlocks
                );

            if (result.Finally != null || result.Fault != null)
            {
                return(Utils.FinallyFlowControl(result));
            }
            return(result);
        }
Exemplo n.º 3
0
 public static Expression ToStatement(TryStatementBuilder builder) {
     ContractUtils.RequiresNotNull(builder, "builder");
     var result = Expression.MakeTry(
         builder._try,
         builder._finally,
         builder._fault,
         builder._catchBlocks
     );
     if (result.Finally != null || result.Fault != null) {
         return Utils.FinallyFlowControl(result);
     }
     return result;
 }
Exemplo n.º 4
0
 public static TryStatement ToStatement(TryStatementBuilder builder)
 {
     Contract.RequiresNotNull(builder, "builder");
     return new TryStatement(
         builder._statementSpan,
         builder._header,
         builder._tryStatement,
         (builder._catchBlocks != null) ? CollectionUtils.ToReadOnlyCollection(builder._catchBlocks.ToArray()) : null,
         builder._finallyStatement
     );
 }