Visual Studio 扩展 - “服务器资源管理器"的上下文菜单 [英] Visual Studio Extention - Context Menu for 'Server Explorer'
问题描述
在 VSIX 项目中,在 .vsct 文件中,我可以看到如何定位不同的对象并提供自定义上下文菜单:
例如,以下内容将针对解决方案资源管理器中的项目节点:
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/><!--<父 guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>--></组>
将 id 属性从 IDM_VS_CTXT_ITEMNODE
更改为 IDM_VS_CTXT_CODEWIN
将导致上下文菜单出现在代码窗口中.
这里有记录:
你可以从那里去.
In a VSIX project, in the .vsct file I can see how to target different objects and provide a custom context menu:
For instance, the following will target an item node in the solution explorer:
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE"/>
<!--<Parent guid="guidSHLMainMenu" id="IDM_VS_MENU_TOOLS"/>-->
</Group>
Changing the id property from IDM_VS_CTXT_ITEMNODE
to IDM_VS_CTXT_CODEWIN
will result in the context menu appearing in the code window instead.
This is documented here: Microsoft Documentation
However, I would like my context menu to appear in the 'Server Explorer' instead. An example and a link to the documentation would be very helpful.
To find Visual Studio menu guids, this usually works.
In your registry set EnableVSIPLogging DWORD to 1, under HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0\General
.
Restart Visual Studio (and computer?) and hold Ctrl+Shift and right click an item in the server explorer, it will open a dialog window with something like this:
You can go from there.
这篇关于Visual Studio 扩展 - “服务器资源管理器"的上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!