Visual Studio 加载项:我如何知道解决方案何时完成加载
我正在编写一个 VS2008 加载项(使用 DTE),需要在当前解决方案加载完成后收到通知。
我尝试使用以下代码:
events = (Events2) applicationObject.Events
events.SolutionEvents.Opened += DoSomeWorkEvent;
不幸的是,从 VS2005 开始,该事件似乎在解决方案开始加载时抛出,而不是在完成时抛出。
简短的互联网搜索产生了 以下线程解释了问题并提出了解决方案(检查每个项目项以查看其是否已完成加载)。
这是可用的最佳解决方案还是有更好的方法来知道解决方案何时完成加载?
I'm writing a VS2008 add-in (using DTE) that needs to be notified after the current solution has finished loading.
I've tried using the following code:
events = (Events2) applicationObject.Events
events.SolutionEvents.Opened += DoSomeWorkEvent;
Unfortunately it seems that since VS2005 the event is thrown when the solution starts to load - and not when it finishes.
A short internet search produced the following thread that explains the problem and suggest a solution (check each project item to see if it finished loading).
Is this the best solution available or is there a better way to know when a solution has finished loading?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决此问题的解决方法 - 我创建了一个在主线程上运行的 Windows.Forms.Timer 并检查解决方案是否已完成加载。
I've found a workaround that solves this problem - I've created a Windows.Forms.Timer that runs on the main thread and checks if the solution has finished loading.