Recipe spawning on pretty much anything using custom GUID/IDs

Pablo Alberto Galiano pointed out on his blog that it is possible to spawn a recipe from a contextual menu... in the text editor!
I found pretty awesome that Recipes could be used out of the Solution Explorer. Just add :

<CommandBar Guid="d309f791-903f-11d0-9efc-00a0c911004f" ID="1037" />

...to the Recipe's host data. It really works!

Edit : Although I have no idea what the type of "DteHelper.GetTarget(dte)" is in that context. And because of the COM layer, I can't seem to find it by watching the variable or using GetType (I get generic COM wrapper objects).



Answer this question

Recipe spawning on pretty much anything using custom GUID/IDs

  • Louis Davidson

    You might find this post interesting: http://www.clariusconsulting.net/blogs/kzu/archive/2006/06/01/GATMenus.aspx

    Pablo works at my company too, and he's a member of the new Service Factory team. He's a fan of GAT too :)


  • Manjeet

    Hi there,

    I tried putting the "Say a message" context menu item to the CS Code Editor and ASPX Editor. But for some reason, the menu is not getting displayed.

    I'm adding the following CommandBar elements under HostData,

    <CommandBar Guid="d309f791-903f-11d0-9efc-00a0c911004f" ID="1037" />

    <CommandBar Guid="D7E8C5E1-BDB8-11D0-9C88-0000F8040A53" ID="53" />

    Am I missing something ..

    Thanks for any help...

    -Santhoo


  • Aldo Donetti

    By the way, the ASPX Editor's command bar is :

    <CommandBar Guid="D7E8C5E1-BDB8-11D0-9C88-0000F8040A53" ID="53" />

    And the I found out that the DteHelper.GetTarget(dte) in this context is the ProjectItem that you're currently editing, which makes complete sense. :)


  • IMauricio

    Don't forget to put a matching recipe reference in your binding recipe! The command bar by itself is not enough to show the contextual element. You need to put a bound or unbound recipe reference whose "isValid" returns true for the context you need.


  • moinj

    Another handy CommandBar... Solution Folders at any level!

    <CommandBar Guid="D309F791-903F-11D0-9EFC-00A0C911004F" ID="1044" />


  • Recipe spawning on pretty much anything using custom GUID/IDs