【发布时间】:2015-02-10 10:55:31
【问题描述】:
所以在 Visual Studio 扩展中,当按下菜单项时,我想检查团队资源管理器中的当前页面。
所以,首先我得到了 ITeamExplorer 对象:
ITeamExplorer teamExplorer = (ITeamExplorer)this.GetService(typeof(ITeamExplorer)).
接下来,我想确保我在待定更改页面上。
if(teamExplorer != null)
{
if(teamExplorer.currentPage is ???)
{
//Do stuff.
}
}
现在,如果我在调试中运行它(注释掉最后一个 if 部分以便它编译,将团队资源管理器打开到挂起的更改页面,并在我获得 ITeamExplorer 对象后中断,我可以检查它并查看当前页面类型为Microsoft.VisualStudio.TeamFoundation.VersionControl.PendingChanges.PendingChangesPageVS。
但我找不到任何可以让我实际比较类型以确保页面属于同一类型的参考。
Microsoft.VisualStudio 有效。 Microsoft.TeamFoundation 有效。但是没有Microsoft.VisualStudio.TeamFoundation。我检查了参考资料,看看我是否忘记包含它,但它也不存在。
它隐藏在其他地方吗?在nuget包中?也许我需要在 Team Foundation Server SDK 中安装?
编辑 1:
在 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies 中找到 dll。我想我需要看看引用私有程序集需要什么。
编辑 2:
将该 dll 复制到 C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v4.5 允许我引用它。但我觉得我在做我不应该做的事情。
【问题讨论】:
-
我一直在阅读该页面并扫描他们链接的一些页面。到目前为止,我还没有发现对这种特殊情况有用的东西。
标签: c# visual-studio tfs visual-studio-2013 visual-studio-extensions