Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

find list item selected by a context menu using MenuCommand

$
0
0

I am building a VS 2015 extension that adds a context menu to items in a Team Explorer query results list using the vsct mechanism.  A MenuCommand is registered via commandService.Add().  That all works fine.  My problem is how to access the selected item data when the commend is triggered.

My command callback:

private void ShowToolWindow(object sender, EventArgs e) { if (sender is MenuCommand) { // need to use sender to extract data from the selected item

// but how??? } }

If MenuCommand can't be used in this way, is there some other way to add the menu item, maybe something that results in a direct callback from the menu item?  I can find the item using ContectMenu.PlacementTarget if I can get hold of the menu item.


Viewing all articles
Browse latest Browse all 4410

Trending Articles