[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(); } }
[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(); } }