Automation of VS.NET IDE Class View

S

Saradhi

Hi All,

I wanted to access the Class View of the VS.NET IDE.
I am able to add my own customized menu items to the Context Menu of Class View.

But Now I want to enable and disable thee menu items according to the item seelcted.
I want to
1) Select some menu items if the selected item is a namespace in the Class View.
2) Select some menu items if the selected item is a code item in the Class View.

I wrote the following code in the QueryStatus Function of my AddIn as follows:

if ( commandName == "PalantirAddIn.Connect.AddNewModule" ){ // Get current selected item object _object = this.VSNET.SelectedItems.SelectionContainer.Item(1); // try to safely cast it to CodeNameSpace if(_object is CodeNamespace ) { // Show MenuItem status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported|vsCommandStatus..vsCommandStatusEnabled; } else { // Hide MenuItem. status = (vsCommandStatus)vsCommandStatus.vsCommandStatusInvisible; }} But this doesnt work for me.Is there anything wrong with the code? Thanks a Lot-SARADHI

--------------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top