Right Click menus for Visual Studio 2010

Imagine that you want to make an extension for Visual Studio 2010 that creates new custom right click menus for the Solution Explorer. Imagine that you could do it by just implementing a good old .NET interface like this:

public class MenuManager : IMenuManager  
{  
    public IEnumerable<IMenuItem> GetMenus(ContextLevels menuForLevel)  
    {  
        var menuItems = new List<IMenuItem>();  
        var menuItem1 = new MenuItem("My Menu1");  
        menuItems.Add(menuItem1);  
        var menuItem2 = new MenuItem("My Menu2");  
        menuItems.Add(menuItem2);  
        return menuItems;  
    }  
  
    public string MainMenu()  
    {  
        return "My Main Menu";  
    }  
}  

Well it turns out you can. In MME I have helped you do exactly that. No more using the convoluted add-in model of Visual Studio to accomplish this goal. And it is also much simpler than using GAX/GAT (that can do so much more to be fair).

You can easily install MME, either by downloading directly from Codeplex or by installing directly from the Extension Manager in Visual Studio 2010 (you can find it under the Tools menu).

MME does not work for the Express editions of VS.

I also recommend installing the MME MenuManager template which you can also find in the Extension Manager.

At codeplex you can read more about implementing and deploying MME’s and also get further insight on the architecture.


Comments

Comments closed.