Visual Studio CommandBar“名称”
在 Visual Studio 2010 中,您可以创建的唯一选项是“菜单栏”上“工具”下的命令栏。在某些情况下,我想知道如何将命令栏放置在标准栏上,或者在右键单击项目文件时找到。
示例:
Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar =
((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.
CommandBars)["MenuBar"];
默认情况下它显示“MenuBar”,我确信还有其他内容,例如“Standard”。但是,我无法找到该列表的资源或文档,我想知道是否有人知道在哪里查找这些“名称”的列表。
提前谢谢你们了。
In Visual Studio 2010, the only option you can create is a commandbar under "Tools" on the "MenuBar". In some cases, I would want to know how to place the command bar on the standard bar, or be found when I right-click a project file.
Example:
Microsoft.VisualStudio.CommandBars.CommandBar menuBarCommandBar =
((Microsoft.VisualStudio.CommandBars.CommandBars)_applicationObject.
CommandBars)["MenuBar"];
By default it shows "MenuBar" and I am certain there is others, such as "Standard". However I am unable to find the resources or documentation for the list, and I wonder if anyone know where to look for list of these "Names".
Thank you guys in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我在开发 Visual Studio 插件时需要解决这个问题。看起来这取决于您安装的内容。例如,我有一些可用的透明案例 CommandBar,因为我使用透明案例集成插件。我会说,更常见的是“代码窗口”、“项目”、“菜单栏”、“解决方案”和“项目”。要具体回答您的问题,您可以使用“标准”和“项目”命令栏。
要生成所有 CommandBar 的列表,您可以创建一个 Visual Studio 插件并将以下代码粘贴到 Connect.cs 中的 OnStartupComplete 中:
结果(超过 300 个):
I needed to figure this out while working on a visual studio plug-in. It looks like it depends on what you have installed. For example, I have some clear case CommandBars available to me because I work with the clear case integration plug-in. I'll echo that the more common ones are "Code Window", "Project", "MenuBar", "Solution", and "Item". To specifically answer your question, you would use the "Standard" and "Project" command bars.
To generate a list of all CommandBars you can create a visual studio plug-in and paste the following code into OnStartupComplete in Connect.cs:
Results (over 300):
我只知道几个,而且我也很想知道这一点,因为我想知道asp.net中html代码窗口的名称。
但以下是我所知道的:
“代码窗口”(右键代码菜单)
“工具”
“菜单栏”
“标准”
编辑:您还可以放置一个 for 循环来查看命令栏名称。 (枚举)
I only know of a few, and I am too wondering this, since I would like to know the name of the html code window in asp.net.
but here are the ones I know:
"Code Window" (right-click code menu)
"Tools"
"MenuBar"
"Standard"
EDIT: Also you can put a for loop to look through the commandbar names. (enumeration)
我认为你可以通过枚举获取所有命令栏:CommandBars.GetEnumerator
I think you can get all commandbars by enumerate : CommandBars.GetEnumerator
要查找特殊命令栏的名称,这对我很有帮助。
只需在 OnConnection() 中实现即可:
每次右键单击您都会获得名称。
To find the name of a special command bar, this helps me very well.
Just implement into the OnConnection():
With every right click you will get the name.