【发布时间】:2010-09-08 12:30:08
【问题描述】:
如何在使用宏加载解决方案时枚举打开的代码窗口(即编辑文档的窗口)?
您可能知道,MSVS 会记住打开的文档,即当您加载解决方案时,IDE 会加载以前打开的文件。我想要做的是在解决方案加载时对这些窗口执行一些操作。
我尝试在 SolutionEvents_Opened 处理程序中访问这些窗口。但是没有运气 - 似乎在调用 SolutionEvents_Opened 时提到的窗口不可用。 DTE.Documents 为空且 DTE.Windows.Items 不包含它们。
我需要一些代码,例如:
Private Sub SolutionEvents_Opened() Handles SolutionEvents.Opened
Dim window As Window = DTE.Documents.Item(?).Windows // one of the opened windows
...
End Sub
【问题讨论】:
标签: vb.net visual-studio scripting automation