Adding Menus to an ArcGIS 10 Add-In

Discussion created by TomFlahive on Oct 20, 2010
I am having a little trouble figuring out how to work with menus when creating an ArcGIS 10 Add-in.  I have 2 issues I???m stuck on:

1) If I want to build a menu with 3 levels, how do I go about doing this using the Add-In component wizard (rather than just coding the XML manually).  Let???s say I want to put a multi-level menu on an Add-In toolbar that looks like this:

Menu Item Level 1
------Menu Item Level 2
------Menu Item Level 2
------------Menu Item Level 3
------------Menu Item Level 3

Can I add such a menu structure using a single Add-In component, or do I need to add multiple Add-In components to arrive at this structure?  And if so, how do I do that?  What is the order that I build this structure?

2) How do I respond to a menu item click event to run my own code?  Previously in ArcGIS 9.3 I would create a Command Object class and point my menu to that command object class.  But I don???t find any Command Objects with ArcGIS 10 add-ins.  And the ESRI documentation that shows how to create an add-in menu links the menu items to pre-existing ESRI classes, so that's not of much help.  How do I link to my own code?