简体   繁体   English

Visual Studio加载项-将上下文菜单项添加到solution-explorer

[英]Visual Studio Add-In - adding a context menu item to solution-explorer

I'm developing my first add-in for Visual studio and we need to add a context menu item to the solution explorer, that shows up for particular file types only (in our case - ".resx"). 我正在为Visual Studio开发第一个外接程序,我们需要向解决方案资源管理器中添加一个上下文菜单项,该菜单项仅针对特定文件类型显示(在我们的示例中为“ .resx”)。

I've been googling for 2 days now, unable to find any tutorials or code-samples... Only very basic things like adding a menu-item to the VS "tools" menu etc. 我已经搜索了2天,无法找到任何教程或代码示例……只有非常基本的内容,例如在VS“工具”菜单中添加菜单项等。

Well, you need to create a dynamically visible command that you will make visible only when the selected node in the Solution Explorer is .resx file and then add the command as a child of the Solution Explorer context menu (you would need GUID:ID pair of the latter). 好吧,您需要创建一个动态可见的命令,仅当解决方案资源管理器中的选定节点为.resx文件时,该命令才可见,然后将该命令添加为解决方案资源管理器上下文菜单的子级(您需要GUID:ID对)后者)。

Here is a good article showing how to do that: http://blogs.rev-net.com/ddewinter/2008/03/22/dynamic-menu-commands-in-visual-studio-packages-part-2/ 这是一篇很好的文章,展示了如何执行此操作: http : //blogs.rev-net.com/ddewinter/2008/03/22/dynamic-menu-commands-in-visual-studio-packages-part-2/

Take a look at this video . 看一下这个视频 It describes how to append and control visibility of a new menu item by IDTCommandTarget interface. 它描述了如何通过IDTCommandTarget界面附加和控制新菜单项的可见性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio AddIn:如何将项目特定命令添加到解决方案资源管理器上下文菜单 - Visual Studio AddIn: How do I Add Item Specific Commands to the Solution Explorer Context Menu 在Visual Studio解决方案资源管理器中将菜单项添加到.cs文件(仅)? - Add menu item to .cs files (only) in Visual Studio solution explorer? Visual Studio 2008:通过项目/解决方案上下文菜单启动自定义构建目标 - 无需加载项 - Visual Studio 2008: Start custom build target via project/solution context menu - without add-in Visual Studio包:设置自定义解决方案资源管理器上下文菜单项的可见性 - Visual Studio Package: Settings the visibility of a custom Solution Explorer context menu item Visual Studio 2010插件 - 将上下文菜单添加到解决方案资源管理器中 - Visual Studio 2010 Plug-in - Adding a context-menu to the Solution Explorer 将菜单添加到外接程序中的Visual Studio菜单栏 - Adding a Menu to the Visual Studio Menu Bar within an Add-In 在“添加”上下文菜单中添加外接程序命令 - Adding an add-in command to the Add context menu 解决方案资源管理器文件中的 VS2010 插件自定义菜单项 - VS2010 add-in custom menu item in files of Solution Explorer 解决方案加载时的Visual Studio加载项挂钩 - Visual Studio add-in hook on solution load 将上下文菜单项添加到Windows资源管理器 - Adding a context menu item to windows explorer
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM