要做到这一点,你可以指定QueryStatus()方法的状态参数作为vsCommandStatus的枚举符。你也可以检查当前的模式及集成开发环境下的模式的属性。
代码样本:
publicvoid QueryStatus(string commandName, vsCommandStatusTextWanted neededText, refvsCommandStatus status, refobject commandText)
{
if (neededText == vsCommandStatusTextWanted.vsCommandStatusTextWantedNone)
{
if (commandName == "AddinSample.Connect.AddinSample"&&
_applicationObject.Mode == vsIDEMode.vsIDEModeDebug)
{
status = (vsCommandStatus)vsCommandStatus.vsCommandStatusSupported |
vsCommandStatus.vsCommandStatusEnabled;
return;
}
}
}
如果您对我们的论坛在线支持服务有任何的意见或建议,请通过
邮件告诉我们。
立刻免费下载
MSDN 论坛好帮手