예제 #1
0
 [DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception
 public static void tf_with(IObjectLife py, Action <IObjectLife> action)
 {
     try
     {
         py.__enter__();
         action(py);
     }
     finally
     {
         py.__exit__();
         py.Dispose();
     }
 }
예제 #2
0
 [DebuggerNonUserCode()] // with "Just My Code" enabled this lets the debugger break at the origin of the exception
 public static void tf_with(IObjectLife py, Action <IObjectLife> action)
 {
     try
     {
         py.__enter__();
         action(py);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         throw;
     }
     finally
     {
         py.__exit__();
         py.Dispose();
     }
 }