How to correctly add a menu item to a merged menu? I'm doing it the following way (see below) but, apparently, it results in two similar menu items being added. It used to work fine in v 4.1
Attached is an example demonstrating the problem (click on "View->New", then on "Add Menu Item")
private static BarItem FindByText(IList items, string text)
{
foreach (BarItem b in items)
{
// ignore the "&" symbol
if (b.Text.Replace("&", "") == text.Replace("&", "")) return b;
}
return null;
}
private void barItem2_Click(object sender, EventArgs e)
{
Bar mergedMainMenu = mainMenu.Manager.GetMergedEquivalent(mainMenu, mainMenu);
ParentBarItem pbi = (ParentBarItem)FindByText(mergedMainMenu.Items, "View");
BarItem item = new BarItem("foo");
pbi.Manager.Items.Add(item);
pbi.Items.Add(item);
}
ClosingFloatingWindow1.zip