trapping Solution Explorer events
I've been tasked with creating an addin that prevents developers from changing the structure of a sol开发者_JS百科ution: they are allowed to edit code, but not move files, projects or filters around, or rename things. The reason is that the build commands are being intercepted by the addin and passed to a custom build tool.
I know there are addins that do this, so it is possible. Does anybody here know which interfaces in EnvDTE or VSIP to use to catch drag and drop evetns on the solution explorer and possibly cancel them? Also, how to get a handle on these interfaces would be appreciated.
Thanks
ps.. This is for Visual Studio versions 2005 and 2008. 2010 will support a different API (MEF) for this.
These links may be of help to you:
http://www.msteched.com/2010/Europe/DEV302
and
http://software.intel.com/sites/products/documentation/hpc/composerxe/en-us/cpp/win/bldaps_cls/cppug_ccw/bldaps_vsauto_objs.htm
The way I ended up handling these issues is by intercepting the project events for ItemAdded, ItemMoved and ItemRemoved on the VCProjectEngineEvents interface as the solution was for c++.
For anyone else having to wander around in the internals of Visual Stuido (hell), I can recommend this site.
You will mostly have to figure things out for yourself, but this site is a fantastic resource for working with the wonders of VS.
精彩评论