public override void Run() { ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider; WindowsDebugger winDebugger = DebuggerService.CurrentDebugger as WindowsDebugger; if (provider == null || winDebugger == null) { return; } ITextEditor textEditor = provider.TextEditor; Breakpoint breakpoint = winDebugger.DebuggerCore.Breakpoints.Add(textEditor.FileName, null, textEditor.Caret.Line, textEditor.Caret.Column, true); // Be careful to remove the breakpoint just once breakpoint.Hit += delegate { if (breakpoint != null) { breakpoint.Remove(); } breakpoint = null; }; winDebugger.DebuggedProcess.Paused += delegate { if (breakpoint != null) { breakpoint.Remove(); } breakpoint = null; }; if (!winDebugger.IsProcessRunning) { winDebugger.Continue(); } }
public override void Run() { SharpDevelopTextAreaControl textEditor = this.Owner as SharpDevelopTextAreaControl; WindowsDebugger winDebugger = DebuggerService.CurrentDebugger as WindowsDebugger; if (textEditor == null || winDebugger == null) { return; } Breakpoint breakpoint = winDebugger.DebuggerCore.AddBreakpoint(textEditor.FileName, null, textEditor.ActiveTextAreaControl.Caret.Line + 1, textEditor.ActiveTextAreaControl.Caret.Column, true); breakpoint.Hit += delegate { breakpoint.Remove(); }; winDebugger.DebuggedProcess.Paused += delegate { breakpoint.Remove(); }; if (!winDebugger.IsProcessRunning) { winDebugger.Continue(); } }