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:
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.private void ShowToolWindow(object sender, EventArgs e) { if (sender is MenuCommand) { // need to use sender to extract data from the selected item
// but how??? } }