How to get the selected items on Source Control History window when creating a Visual Studio Extension?(创建 Visual Studio 扩展时如何获取源代码管理历史记录窗口中的选定项目?)
问题描述
我开发了一个 Visual Studio 扩展.我在源代码管理历史记录窗口的上下文菜单中附加了一个按钮(上面有变更集详细信息"、比较"等的菜单)
I develop a Visual Studio extension. 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.
更新:
我正在使用团队基础服务器作为源代码控制.这是我要访问的窗口的屏幕截图.截图
I'm using team foundation server as source control. 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);
(包是 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.
请帮忙:)谢谢.
推荐答案
也许这会对您的需求有所帮助:工具窗口
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);
...
这篇关于创建 Visual Studio 扩展时如何获取源代码管理历史记录窗口中的选定项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:创建 Visual Studio 扩展时如何获取源代码管理历史记录窗口中的选定项目?
基础教程推荐
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
