I recently got into Visual Studio 2010 package development, with the Visual Studio 2010 SDK. I've got my debugging environment all set up, and everything is working as it should.
However, my add-on pretty much needs to know when somebody opens a project - or else it will not refresh its data, depending on which project is open.
Furthermore, it would be awesome to see when the user switches document to something else, or changes something in the document. However, the first thing (detect when somebody opens a project) is the most important.
Is there any way I can do this? Are th开发者_开发知识库ere events in Visual Studio that will allow me to do this? If so, what are these called, and how do I utilize them?
The macro model and the add-in model both use the same interface so you can use the macro sample to get ideas. Use Tools -> Macro -> Macros IDE -> Samples -> EnvironmentEvents to see all the events the Visual Studio extension model supports. Specifically look at EnvDTE.DocumentEvents
and EnvDTE.ProjectsEvents
.
精彩评论