[英]How to get the selected items on Source Control History window when creating a Visual Studio Extension?
I develop a Visual Studio extension . 我开发了Visual Studio扩展 。 I attached a button to the Source Control History Window's Context Menu (the menu with 'changeset details', 'compare', etc.. on it) 我在“源代码控制历史记录”窗口的上下文菜单(带有“变更集详细信息”,“比较”等的菜单)上附加了一个按钮。
I need to get the selected History items from the window, but couldn't figure it out how to do it. 我需要从窗口中获取选定的“历史记录”项目 ,但无法弄清楚该如何进行。
Update: 更新:
I'm using team foundation server as source control. 我正在使用Team Foundation Server作为源代码管理。 Here's the screenshot of the window i want to access to. 这是我要访问的窗口的屏幕截图。 Screenshot 截图
I have found a way to retrieve the window object's data, but i still have some issues: 我找到了一种检索窗口对象数据的方法,但是仍然存在一些问题:
package.FindToolWindow(typeof(/*I don't know the type of the window*/), 0, false);
(package is instance of Microsoft.VisualStudio.Shell.Package class) (程序包是Microsoft.VisualStudio.Shell.Package类的实例)
What is the type of the Source Control History window (the one on the screenshot)? “源代码管理历史记录”窗口的类型是什么(屏幕截图中的一个)? This is the missing part of the puzzle i think. 这是我认为的难题的缺失部分。
Please help :) Thanks. 请帮助:)谢谢。
Maybe this will be helpful for your needs: Tool Window 也许这将对您的需求有所帮助: 工具窗口
I dont know your other code parts, but I guess you initiate a window application, where you want to render the history list. 我不知道您的其他代码部分,但是我想您会启动一个窗口应用程序,在此您要呈现历史记录列表。 This window application needs: 该窗口应用程序需要:
private FirstToolWindow window;
private void ShowToolWindow(object sender, EventArgs e)
{
window = (FirstToolWindow) this.package.FindToolWindow(typeof(FirstToolWindow), 0, true);
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.