[英]Changing the title of the Solution Explorer tool window in visual studio 2015
In visual studio, in the Solution Explorer you can right clock and select "New Solution Explorer from here" 在Visual Studio中,您可以在解决方案资源管理器中进行计时,然后选择“从这里开始新的解决方案资源管理器”
Then a new Solution explorer tool window open - but it has the same name "Solution Explorer" - and no way to reflect the folder it represents or anything.
然后将打开一个新的解决方案资源管理器工具窗口-但其名称为“ Solution Explorer”-无法反映其代表的文件夹或其他内容。
If I want to use multiple solution explorer windows - it'll be best if I can determine a name for them - or if their name would be representative of the root item they refer to. 如果要使用多个解决方案资源管理器窗口-最好为它们确定一个名称-或者它们的名称代表它们所引用的根项目。
Is there a visual studio extension that does that? 是否有Visual Studio扩展程序可以做到这一点?
You can the title value via the property named caption. 您可以通过名为标题的属性来获得标题值。 Here is a simple demo for your reference.
这是一个简单的演示供您参考。
DTE2 dte = (DTE2)this.ServiceProvider.GetService(typeof(DTE));
List<Window> list = new List<Window>();
foreach (Window w in dte.Windows)
{
if (w.Caption == "Solution Explorer")
{
list.Add(w);
}
}
for (int i = 0; i < list.Count; i++)
{
list[i].Caption = "Test" + i;
}
您还可以如下所示直接获取解决方案资源管理器窗口并更新名称:
(dte.Windows.Item(EnvDTE.Constants.vsWindowKindSolutionExplorer)).Caption = "Foo"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.