Esempio n. 1
0
 public static void with(IPython py, Action action)
 {
     try
     {
         py.__enter__();
         action();
     }
     catch (Exception ex)
     {
         throw ex;
     }
     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 with(IPython py, Action <IPython> action)
 {
     try
     {
         py.__enter__();
         action(py);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         throw;
     }
     finally
     {
         py.__exit__();
         py.Dispose();
     }
 }
Esempio n. 3
0
 public static TOut with <TIn, TOut>(IPython py, Func <TIn, TOut> action) where TIn : IPython
 {
     try
     {
         py.__enter__();
         return(action((TIn)py));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         return(default(TOut));
     }
     finally
     {
         py.__exit__();
         py.Dispose();
     }
 }
Esempio n. 4
0
 public static void with <T>(IPython py, Action <T> action) where T : IPython
 {
     try
     {
         py.__enter__();
         action((T)py);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         throw ex;
     }
     finally
     {
         py.__exit__();
         py.Dispose();
     }
 }
Esempio n. 5
0
 public PyPlot(IPython python)
 {
     this.python = python;
 }