作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试通过菜单查找所有已启用的 resharper 命令。我可以使用以下代码找到所有菜单项。但是我找不到如何从 DTE 命令集合中获取实际命令。
var resharper = ((CommandBars)_dte.Application.CommandBars)["RESHARPER"];
var refactor = (CommandBarPopup)resharper.Controls["&Refactor"].Control;
foreach (var c in refactor.Controls)
{
var cbb = c as CommandBarButtonClass;
if (cbb != null)
{
yield return new VoiceCommand
{
Command = _dte.Commands.Item(???),
Key = cbb.accName,
};
}
}
我应该使用什么属性来查找命令(??? 上面)?
谢谢,埃里克
最佳答案
您想使用 CommandInfo method ,像这样:
Guid guid;
int id;
_dte.Commands.CommandInfo(cbb, out guid, out id);
yield return new VoiceCommand
{
Command = _dte.Commands.Item(guid, id),
Key = cbb.accName,
};
关于visual-studio - 如何从 Visual Studio 2012 中的 CommandBarButton 获取 EnvDTE.Command,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17003364/
我正在尝试制作 outlook 2007 插件。在为 CommandBarButton 设置图标时,图标的背景变黑了。 我使用的代码是: private CommandBar _menuBar; pr
我需要在 Visio 窗口中使用一组按钮创建自己的工具栏。下一段代码生成工具栏(有效)、创建按钮(有效),并为它们分配 Click 事件处理程序。 vsoCommandBar = vsoCommand
VBA 和 VB6 插件对象模型 (VBIDE) 公开了 CommandBarEvents具有 Click 的对象event ,事件签名为: Dim WithEvents CmdBarEvents A
我正在尝试通过菜单查找所有已启用的 resharper 命令。我可以使用以下代码找到所有菜单项。但是我找不到如何从 DTE 命令集合中获取实际命令。 var resharper = ((Command
我是一名优秀的程序员,十分优秀!