change top level menu text dynamically RRS feed

  • Question

  • Hi Folk

    I put menu item in visual studio top menu for my extension, now I want the text for that menu item to be changed on visual studio open if extension is not registered

    In the other words I want vs menu to be like this

    File|Edit|View"Refactor|...|My Extension|Help --- if registered

    File|Edit|View"Refactor|...|My Extension(trial)|Help --- if trial

    I added this menu item with vsct file, now is it possible to change this text, or to create menu item dynamically on visual studio start?

    Actually I know how to change the name for existing command, the problem is that Package.Initialized method is called only if user click on menu item, so the question in which event or where can I change name? 

    Tuesday, July 24, 2012 8:12 PM


  • Text can only be changed if QueryStatus is run. There are alternate things you could do (like two commands and have their visibility driven by a UI context), but they also require you to run code so they don't help any. You can make your package auto-load on startup, it is frowned upon as it decreases startup perf (as we have to map your assembly from disk and fault in some of its pages) but there isn't really another way to have dynamically changing text without running some code.


    Tuesday, July 24, 2012 8:41 PM