简体   繁体   English

如何以编程方式刷新Visual Studio解决方案资源管理器?

[英]How can I programmatically refresh Visual Studio Solution Explorer?

How can I programmatically refresh Visual Studio Solution Explorer? 如何以编程方式刷新Visual Studio解决方案资源管理器?

I can get a hold of the solution explorer window object, but don't know what to do with it! 我可以握住解决方案资源管理器窗口对象,但不知道该怎么做!

var solutionExplorer = (UIHierarchy)DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object();

Thanks. 谢谢。

Usually you can figure out these things by recording a temporary macro, doing what you want to do, and seeing what comes out in the macro editor. 通常,您可以通过记录一个临时宏,执行所需的操作以及查看宏编辑器中显示的内容来弄清楚这些事情。

Indeed, this is a case where it's probably only by recording a temporary macro that you can figure out how to do this. 确实,在这种情况下,可能只有记录临时宏,您才能弄清楚该怎么做。 Here's the command to refresh the Solution Explorer: 这是刷新解决方案资源管理器的命令:

DTE.Commands.Raise("{1496A755-94DE-11D0-8C3F-00C04FC2AAE2}", 222, null, null)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何以编程方式刷新 Visual Studio WPF 设计器? - How can I programmatically refresh Visual Studio WPF designers? Visual Studio-解决方案资源管理器中“刷新”按钮的用途 - Visual Studio - purpose of 'Refresh' button in solution explorer 如何在解决方案资源管理器中以编程方式更新/刷新字形? - How to update / refresh glyphs programmatically in Solution Explorer? 当我单击解决方案资源管理器刷新按钮时,为什么 Visual Studio 不刷新文件夹? - Why doesn't Visual Studio refresh the folders when I click the Solution Explorer refresh button? 我可以折叠Visual Studio解决方案资源管理器中的所有节点吗? - Can i collapse all nodes in solution explorer in visual studio? Visual Studio Community 2019 中的解决方案资源管理器如何刷新? - How can the Solution Explorer in Visual Studio Community 2019 be refreshed? 如何在调试时在Visual Studio 2008中查看解决方案资源管理器? - How can I see the solution explorer in Visual Studio 2008 while debugging? 如何更改解决方案资源管理器的字体大小(在 Visual Studio 中) - How do I change the font size of Solution Explorer (in Visual Studio) Visual Studio的解决方案资源管理器 - Solution explorer of visual studio 切换分支不会刷新Visual Studio中的解决方案资源管理器 - Switching branches does not refresh Solution Explorer in Visual Studio
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM