I'd like to create an extension to Visual Studio that will allow someone to select any text in an editor, right-click to get a context menu, and then perform some action on the text by clicking on my custom menu item.
Let's say for example that my custom menu item is called "Email...". The new context menu for the editor might look something like this:
Breakpoint
Run to Cursor
Cut
Copy
Paste
Email...
Outlining
I'd also like to add a popup (adornment?) with options. In this case it could be things like To
, Subject
, and CC
fields.
I think that some of this can be done with MEF using editor extensions, like the popup and the actual code for firing off an email. But it looks like I need a VSPackage
to add the context menu item. From what I've read, I can bundle the MEF piece and the VSPackage
together.
This is where I get stuck. I need an in-depth reference with details to implement both parts, but I also need information on how to integrate them. MSDN has me going around in circles.
Is there any good, solid example code or documentation (even books) that I can learn from?