如何使用 Visual Studio 加载项打开 TFS 变更集详细信息对话框视图?
我在 TFS 中有一个特定的工件,例如变更集“123”,其 URI “vstfs:///VersionControl/Changeset/123”。我意识到链接 "http:// /tfs:8080/tfs/web/UI/Pages/Scc/ViewChangeset.aspx?changeset=123" 将使用以下命令打开变更集详细信息视图网络浏览器。
我想做的是打开 Visual Studio 内的变更集详细视图。我嵌入此内容的位置是构建摘要中的自定义部分。我将这个自定义部分实现为 VisualStudio 插件。这是一张图片:
“Release Build”部分是定制的,将提供有关电子邮件的信息一旦这样的版本发布,它将发送给所有人。
此部分中的 Changeset 627 是一个已自动转换为链接的 Button 控件。按钮后面的“Click”处理程序起作用。目前的代码如下所示:
...
string link = buildDetailView.TeamProjectCollection.Uri.AbsoluteUri.Substring(0, buildDetailView.TeamProjectCollection.Uri.AbsoluteUri.LastIndexOf('/'));
link += "/web/UI/Pages/Scc/ViewChangeset.aspx?changeset=";
link += ((Button)sender).Content;
Process.Start(new ProcessStartInfo(link));
e.Handled = true;
...
此代码将打开一个新的浏览器选项卡并显示正确的页面。但是,我希望它在 Visual Studio 中打开变更集详细信息。就像“关联变更集”部分底部的按钮一样。当您单击链接“Changeset 627”时,它将在 Visual Studio 中打开该变更集。
编辑1
如果我发布一张图片,可能会更清楚到底想要的结果是什么。 我想使用 API 打开“变更集详细信息”窗口。
I have a specific artifact in TFS, say changeset "123", which has the URI "vstfs:///VersionControl/Changeset/123". I realized that the link "http://tfs:8080/tfs/web/UI/Pages/Scc/ViewChangeset.aspx?changeset=123" will open the changeset detail view using the web-browser.
What I would like to do is open the changeset detail view inside visual studio. The place where I am embedding this is a custom section inside the build summary. I implemented this custom section as a VisualStudio Plugin. Here is a picture:
The section "Release Build" is custom-made and will provide information about an email that will be send to everyone, once such a build is released.
The Changeset 627 inside this section is a Button control that has automatically been transformed into a link. The "Click"-Handler behind the button works. The code currently looks like this:
...
string link = buildDetailView.TeamProjectCollection.Uri.AbsoluteUri.Substring(0, buildDetailView.TeamProjectCollection.Uri.AbsoluteUri.LastIndexOf('/'));
link += "/web/UI/Pages/Scc/ViewChangeset.aspx?changeset=";
link += ((Button)sender).Content;
Process.Start(new ProcessStartInfo(link));
e.Handled = true;
...
This code will open a new Browser tab and show the correct page. However, I would like it to open the changeset detail inside Visual Studio. Just like the button at the bottom in section "Associated Changesets" does. When you click on the link "Changeset 627", it will open that changeset inside Visual Studio.
EDIT 1
It may be a bit clearer what exactly the desired outcome is, if I post a picture of it.
The "Changeset Details" Window is what I would like to open using the API.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请查看以下博客文章:
本质上,您需要引用以下程序集:
然后您可以使用
VersionControlExt.ViewChangesetDetails(int changesetId)
以显示加载项中的特定变更集:这将打开一个对话框,向用户显示有关特定变更集的所有详细信息。 (如果用户在“查找变更集”对话框中选择“详细信息...”,则会出现相同的对话框。)
Take a look at the following blog posts:
Essentially, you need references to the following assemblies:
Then you can use
VersionControlExt.ViewChangesetDetails(int changesetId)
to display a specific changeset from your add-in:This brings up a dialog that shows the user all the details about a particular changeset. (It is the same dialog that appears if the user selects "Details..." in the "Find Changesets" dialog.)
在 VS 2015 中,您可以使用以下代码,取自 这里
In VS 2015 you can use the following code taken from here