protected GetMenuItem ( System.Windows.Forms.CommandBarMenu menu, string id ) : |
||
menu | System.Windows.Forms.CommandBarMenu | |
id | string | |
return |
protected CommandBarItem GetMenuItem(CommandBarMenu menu, string id)
{
//need to simulate the user clicking on this in order to actually get populated.
((ChoiceGroup)menu.Tag).OnDisplay(null, null);
foreach(CommandBarItem item in menu.Items)
{
if (((ChoiceRelatedClass)item.Tag).Id == id)
return item;
}
//NO NO: this is not necessarily an error. remember, we are testing!
// throw new ConfigurationException("could not find item '"+id +"'.");
return null;
}