如何从 Visual Studio 包 (VSIX) 检测解决方案或项目构建?
如何从 Visual Studio 包 (VSIX) 检测解决方案或项目构建?
From a visual studio package (VSIX) how do I detect a solution or project build?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果程序集中有 Package 类,您可以执行以下操作:
然后查看 IsOpen 属性,查看解决方案是否打开...查看 Projects 属性以查找项目。
但是,如果您的意思是打开解决方案时如何获取事件...那么解决方案,例如:
ref: VSIX: Getting DTE object ref: http://msdn.microsoft.com/en-us/library/envdte.solution.aspx
参考:http://msdn.microsoft.com/en-us/library/ envdte._solution.projects.aspx
If you have a Package class in your assembly, you can do:
Then look at then IsOpen property, to see if the solution is open... the look at the Projects property to find the projects.
However, if you mean you how do I get an event when a solution is opened... then Solutions, for example:
ref: VSIX: Getting DTE object ref: http://msdn.microsoft.com/en-us/library/envdte.solution.aspx
ref: http://msdn.microsoft.com/en-us/library/envdte._solution.projects.aspx
查看
DTE.Events.BuildEvents
,其中有OnBuildBegin
和OnBuildDone
事件。Have a look at
DTE.Events.BuildEvents
there are events forOnBuildBegin
andOnBuildDone
.