Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnregisterMenu & Readding Menus #71

Open
kiwidoggie opened this issue Sep 5, 2017 · 2 comments
Open

UnregisterMenu & Readding Menus #71

kiwidoggie opened this issue Sep 5, 2017 · 2 comments

Comments

@kiwidoggie
Copy link

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.

@kiwidoggie
Copy link
Author

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.

@kiwidoggie kiwidoggie changed the title UnregisterMenu UnregisterMenu & Readding Menus Sep 6, 2017
@abeckus
Copy link
Contributor

abeckus commented Sep 8, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants