Visual Studio 2010 SDK Scan Source files in project
-
06-10-2020 - |
Pregunta
I'm working with the 2010 SDK and I am trying to figure out how to tie into VS in someway that I have a background process running that is constantly analyzing .CS files in the current project and adding them to a dictionary so I can show some graphical cues in the editor of a custom text document that I have.
I have been doing quite a lot of research here: http://msdn.microsoft.com/en-us/library/bb166441.aspx
But i cant seem to find a way to "Hook" into VS ...sort of an entry point so this service can run in the background while the project is open.
So far I have an Editor Classifier Project that I have done some modifications to the editor with...how can I monitor files in the background?
Solución
Did you start with a Visual Studio Managed Extensibility Framework ? I found a load of samples at http://learnvsxnow.codeplex.com
Perhaps of special interest would be "Automatically loading packages": http://dotneteers.net/blogs/divedeeper/archive/2008/03/23/LVNSideBar1.aspx
And then you can start a new thread for your actually working process.
Hope this helps.
Otros consejos
You can implement the IVsTrackProjectDocumentsEvents2
interface to listen to project events such as adding a file to a project.
OnAfterAddFilesEx
, OnAfterRemoveFiles
, and OnAfterRenameFiles
are the methods you'll be interested in.