문제

I developed an Addin for VS2012, it is displayed in the code window (editor's) context menu. There's a menu which has a sub-menu. Sub-menu items are added dynamically, for instance..

 Cut
 Copy
 Paste
   .
   .
   .
 My Menu >  sub menu item 1
            sub menu item 2
            sub menu item 3

Now for Visual Studio 2013 I need to convert (almost re-write) the addin as VSPackage.

I am able to create a command, but I cannot add commands dynamically as sub menu items.

Please download the source code (VSPackage for VS2013) from: http://sdrv.ms/INbIu2

Question

How can I make a menu and dynamic sub menu in VSPackage?

I would really appreciate any example.

Thanks a lot!

도움이 되었습니까?

해결책

Use the DynamicItemStart flag on a command definition in your .vsct file: How to: Dynamically Add Menu Items.

Also, check the respective "Walkthrough" topics.

다른 팁

The VSPackage you are creating can still add and remove commands via the same APIs that you used from your Add-In.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top