Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to override ViewCode command?

$
0
0

It is almost a week that I am trying to figure out how to override ViewCode command. I have tried different things without any success.

What I have done is to add a UsedCommand element to UsedCommands in vsct file and added my command handler using IMenuCommandService.

<UsedCommands>  <UsedCommand guid="guidVSStd97" id="cmdidViewCode" />    </UsedCommands>

var viewCodeCommand = new OleMenuCommand(viewCodeCommand_Run, StandardCommands.ViewCode);
viewCodeCommand.BeforeQueryStatus += new EventHandler(viewCodeCommand_BeforeQueryStatus);
mcs.AddCommand(viewCodeCommand);

This is exactly what has been suggested in lots of blogs and samples over the internet. What else is required?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>