Esempio n. 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();
     }
 }
Esempio n. 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();
     }
 }