UnregisterMenu & Readding Menus
Opened this issue · 2 comments
Hello, currently I am looking for a "UnregisterMenu" I make sure that I unregister all command before hand, but I have added this to CommandServiceBase (and the Interface as well)
public virtual void UnregisterMenu(object menuTag, ICommandClient client)
{
MenuInfo info = GetMenuInfo(menuTag);
if (info == null)
return;
UnregisterMenuInfo(info, client);
}
protected virtual void UnregisterMenuInfo(MenuInfo info, ICommandClient client)
{
info.Commands = 0;
m_menus.Remove(info);
}
Which seems to remove the menu properly, but for some reason when re-registering the menu it never shows up. I have no idea what I am missing and was hoping someone could enlighten me.
I also noticed that this isn't caused by my removal code at all. I disabled all of that code all together so it isn't referenced. Then if I leave the MenuInfo added, for example, with the information MenuText = "Test"
CommandTag = "<random string>:Test"
and I have confirmed that the random string before is different on the re-add. I have checked the CommandService.m_commands and the command gets removed and readded, but the menu bar stops updating. I don't know why.
Hello,
Thanks for using ATF and posting issues.
Currently ATF project is in maintenance mode.
All the questions/issues/pull requests will look at but not any time soon.
Alan