作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
使用VS2010
感谢汉斯(因为我要低调地回答我自己的问题8个小时)
Sub CreateBreakPoint()
Dim doc As TextDocument = _
CType(DTE.ActiveDocument.Object("TextDocument"), TextDocument)
Dim point As EditPoint = doc.StartPoint.CreateEditPoint
While point.NextBookmark()
Try
point.ClearBookmark()
DTE.Debugger.Breakpoints.Add("", DTE.ActiveDocument.FullName, point.Line(), 1, "", dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, "c#", "", 0, "", 0, dbgHitCountType.dbgHitCountTypeNone)
Catch ex As Exception
MsgBox("error: " + ex.Message)
End Try
End While
MsgBox("Done")
End Sub
Public Module BookMarksToBreakPoints
Sub TemporaryMacro()
Dim bookmarkWin As Window = DTE.Windows.Item(WindowKinds.vsWindowKindBookmarks)
While True
Try
DTE.ExecuteCommand("Edit.NextBookmark")
DTE.ExecuteCommand("Edit.ToggleBookmark")
DTE.ExecuteCommand("Debug.ToggleBreakpoint")
Catch e As Exception
MsgBox("Done")
Exit While
End Try
End While
End Sub
End Module
最佳答案
感谢Hans Passant朝着正确的方向前进。最后的宏:
Sub CreateBreakPoint()
Dim doc As TextDocument = _
CType(DTE.ActiveDocument.Object("TextDocument"), TextDocument)
Dim point As EditPoint = doc.StartPoint.CreateEditPoint
While point.NextBookmark()
Try
point.ClearBookmark()
DTE.Debugger.Breakpoints.Add("", DTE.ActiveDocument.FullName, point.Line(), 1, "", dbgBreakpointConditionType.dbgBreakpointConditionTypeWhenTrue, "c#", "", 0, "", 0, dbgHitCountType.dbgHitCountTypeNone)
Catch ex As Exception
MsgBox("error: " + ex.Message)
End Try
End While
MsgBox("Done")
End Sub
关于visual-studio - DTE.ExecuteCommand(“Edit.NextBookmark”),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7731231/
使用VS2010 感谢汉斯(因为我要低调地回答我自己的问题8个小时) Sub CreateBreakPoint() Dim doc As TextDocument = _
我是一名优秀的程序员,十分优秀!