2

I've been tasked with creating an addin that prevents developers from changing the structure of a solution: 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.

2
  • What about if someone doesn't use solution explorer to move the files - someone moves a file on disk and then includes it in the project? Feb 15, 2011 at 20:40
  • Thats OK, so long as it has not been done in VS: if users are going to mess around in the file system then the problems that result will be theirs :)
    – Kell
    Feb 16, 2011 at 13:57

2 Answers 2

0

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

2
  • Thanks. I should update my question to reflact that this is for older versions of VS (2005/2008)
    – Kell
    Feb 15, 2011 at 17:06
  • 1
    I don't see how either of those links are helpful with regards to the question. Feb 16, 2011 at 0:53
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.