protected void OnDeleted() { bool deleted = false; DebuggingService.Breakpoints.BreakpointRemoved -= breakpointRemovedHandler; foreach (TreePath path in tree.Selection.GetSelectedRows()) { TreeIter iter; if (!store.GetIter(out iter, path)) { continue; } var bp = (Breakpoint)store.GetValue(iter, (int)Columns.Breakpoint); bps.Remove(bp); deleted = true; } DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler; if (deleted) { UpdateDisplay(); } }
public static void SetLiveUpdateMode(PinnedWatch watch, bool liveUpdate) { if (watch.LiveUpdate == liveUpdate) { return; } watch.LiveUpdate = liveUpdate; if (liveUpdate) { var bp = new Breakpoint(watch.File, watch.Line); bp.TraceExpression = "{" + watch.Expression + "}"; bp.HitAction = HitAction.PrintExpression; bp.NonUserBreakpoint = true; lock (breakpoints) breakpoints.Add(bp); pinnedWatches.Bind(watch, bp); } else { pinnedWatches.Bind(watch, null); lock (breakpoints) breakpoints.Remove(watch.BoundTracer); } }
bool DeleteSelectedBreakpoints() { bool deleted = false; breakpoints.BreakpointRemoved -= OnBreakpointRemoved; try { // Note: since we'll be modifying the list of breakpoints, we need to sort // the paths in reverse order. var selected = tree.Selection.GetSelectedRows(); Array.Sort(selected, new TreePathComparer(true)); foreach (var path in selected) { TreeIter iter; if (!store.GetIter(out iter, path)) { continue; } var bp = (BreakEvent)store.GetValue(iter, (int)Columns.Breakpoint); lock (breakpoints) breakpoints.Remove(bp); deleted = true; } } finally { breakpoints.BreakpointRemoved += OnBreakpointRemoved; } return(deleted); }
protected override void OnPointerReleased(PointerReleasedEventArgs e) { previewPointVisible = true; var textView = TextView; var offset = _editor.GetOffsetFromPoint(e.GetPosition(this)); if (offset != -1) { var lineClicked = -1; lineClicked = textView.Document.GetLineByOffset(offset).LineNumber; // convert from text line to visual line. var currentBreakPoint = _manager.OfType <Breakpoint>().FirstOrDefault(bp => bp.FileName == _editor.Editor.SourceFile.FilePath && bp.Line == lineClicked) as BreakEvent; if (currentBreakPoint != null) { _manager.Remove(currentBreakPoint); } else { if (!string.IsNullOrEmpty(_editor.Editor.SourceFile.FilePath)) { _manager.Add(_editor.Editor.SourceFile.FilePath, lineClicked); } } } InvalidateVisual(); }
protected void OnDeleted() { TreeIter iter; if (tree.Selection.GetSelected(out iter)) { Breakpoint bp = (Breakpoint)store.GetValue(iter, (int)Columns.Breakpoint); bps.Remove(bp); } }