Open resource editor for resx-file. Press "Insert" key, but the new string is not inserter. It will be inserted only if the context menu was shown before.
Not figured out why the lazy initialization for context menu actions needed, but the bug is in MenuService, imho.
public static ContextMenuStrip CreateContextMenu(object owner, string addInTreePath)
{
if (addInTreePath == null) {
return null;
}
try {
List<MenuItemDescriptor> descriptors = AddInTree.BuildItems<MenuItemDescriptor>(addInTreePath, owner, true);
ContextMenuStrip contextMenu = new ContextMenuStrip();
contextMenu.Items.Add(new ToolStripMenuItem("dummy"));
contextMenu.Opening += delegate {
contextMenu.Items.Clear();
AddItemsToMenu(contextMenu.Items, descriptors);
};
contextMenu.Opened += ContextMenuOpened;
contextMenu.Closed += ContextMenuClosed;
return contextMenu;
} catch (TreePathNotFoundException) {
MessageService.ShowError("Warning tree path '" + addInTreePath +"' not found.");
return null;
}
}