加载项:如何获取用户选择的断点 [英] Add-in: How to get the user-selected breakpoint

查看:71
本文介绍了加载项:如何获取用户选择的断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨- 

致力于VS 2013和VS 2015的C#加载项,该加载项提供了一些用于调试会话的UI元素.  

其中一个要素是对数据断点的增强.  我们可以检测到何时有人想要添加数据断点,并为此提供了增强的对话框,它可以按预期工作.

我们遇到的问题是当有人想要编辑该数据断点时.我们检测到该事件,但无法弄清楚如何获取他们尝试编辑的断点.  

请注意,我们不想检测调试器何时击中断点.而是,我们需要用户在Visual Studio UI中选择的断点.   (甚至只是文本也可以.)

谢谢!

解决方案

不幸的是,我认为这是不可能的. Breakpoints工具窗口不参与IDE的选择状态跟踪.一些工具窗口(例如解决方案"和服务器资源管理器")会跟踪活动选择的项目(通常用于支持显示 属性工具窗口中所选项目的属性).但是断点工具窗口不执行此操作.

有一个有用的"组件诊断"扩展程序,它可以跟踪活动的选择状态,如果您启动它并观看 当前选择" 选择和UIContext"的标签.类别,在断点工具窗口中选择不同的断点时,您不会看到选择状态更改:-(

此致


Hi - 

Working on a C# add-in for VS 2013 and VS 2015 that provides a few UI elements for debug sessions.  

One of the elements is an enhancement for data breakpoints.  We can detect when someone wants to add a data breakpoint, and we provide our enhanced dialog for that, and it works as expected.

The problem we're having is when someone wants to edit that data breakpoint.  We detect the event, but can't figure out how to get the breakpoint they are trying to edit.  

Notice that we're not wanting to detect when a breakpoint is being hit by the debugger.  Rather, we need the breakpoint selected by the user in the Visual Studio UI.   (Even just the text will do.)  

Thanks!

解决方案

Unfortunately, I don't believe this is possible. The Breakpoints toolwindow doesn't participate in the IDE's selection state tracking. Some toolwindows (like the Solution and Server Explorer) track the actively selected item (usually to support displaying properties of a selected item in the properties toolwindow). But the breakpoint toolwindow doesn't do this.

There's a useful "Component Diagnostics" extension , which amongst other things tracks the active selection state, and if you launch this and watch the "Current Selection" tag of the "Selection And UIContext" category, you'll see no selection state changes when selecting different breakpoints in the breakpoint toolwindow :-(

Sincerely,


这篇关于加载项:如何获取用户选择的断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆