예제 #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
                ));
 }
예제 #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);
        }
예제 #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;
 }
예제 #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
     );
 }