public bool CheckIfBreakpointExists(string filePath, CursorPos position) { foreach (Breakpoint breakpoint in dte.Debugger.Breakpoints) { if (breakpoint.File.Equals(filePath) && breakpoint.FileLine == position.lineNumber) { return(true); } } return(false); }
public void RemoveBreakpoints(string filePath, CursorPos position) { mTalkPoints.RemoveAll(b => (b.filePath.Equals(filePath) && b.position.lineNumber == position.lineNumber)); foreach (Breakpoint breakpoint in dte.Debugger.Breakpoints) { if (breakpoint.File.Equals(filePath) && breakpoint.FileLine == position.lineNumber) { breakpoint.Delete(); } } }
public void AddProfilePointToCurrentLine(int lineNumber) { try { var cursorPos = new CursorPos(lineNumber, 15); var filePath = GetActiveDocumentPath(); //Toggling Talkpoint //RemoveIfTalkpointsExists(filePath, cursorPos); //if (CheckIfBreakpointExists(filePath, cursorPos)) //{ // RemoveBreakpoints(filePath, cursorPos); // return; //} Talkpoint profilepoint = new Profilepoint(filePath, cursorPos, true, lineNumber, functionLevelDetailsHandler); AddTalkPoint(profilepoint); } catch (Exception exp) //We have to catch the exception here, or the IDE can crash { Debug.WriteLine(exp.StackTrace); } }
public void RemoveIfTalkpointsExists(string filePath, CursorPos position) { mTalkPoints.RemoveAll(t => (t.filePath.Equals(filePath) && t.position.lineNumber == position.lineNumber)); }
public Talkpoint(string filePath, CursorPos position, bool doesContinue = false) { this.filePath = filePath; this.position = position; this.doesContinue = doesContinue; }