public void TracebackEvent(object sender, IPYTracebackEventArgs e) { FunctionCode code = e.frame.f_code; string filename = code.co_filename; try { switch (e.result) { case "call": TracebackCall(e); break; case "line": TracebackLine(e); break; case "return": TracebackReturn(e); break; default: break; } } catch (Exception ex) { Invoke((Action)(() => { ExceptionViewer ev = new ExceptionViewer("TracebackEvent", ex); ev.ShowDialog(); })); } }
private void TracebackCall(IPYTracebackEventArgs e) { if (e.frame != null) { int lineNo = (int)e.frame.f_lineno; HighlightLine(lineNo, Brushes.LightGreen, Brushes.Black); } }
private void TracebackLine(IPYTracebackEventArgs e) { if (e.frame != null) { CurrentLineNumber = (int)e.frame.f_lineno; UpdateCurrentLineString(); } }
private void TracebackReturn(IPYTracebackEventArgs e) { if (e.frame != null) { CurrentLineNumber = (int)e.frame.f_code.co_firstlineno; UpdateCurrentLineString(); } }
private void TracebackLine(IPYTracebackEventArgs e) { int lineNo = (int)e.frame.f_lineno; HighlightLine(lineNo, Brushes.Yellow, Brushes.Black); }
private void TracebackReturn(IPYTracebackEventArgs e) { int lineNo = (int)e.frame.f_code.co_firstlineno; HighlightLine(lineNo, Brushes.LightPink, Brushes.Black); }