if(connectmode == extensibility.ext_connectmode.ext_cm_uisetup || connectmode == extensibility.ext_connectmode.ext_cm_startup || connectmode == extensibility.ext_connectmode.ext_cm_afterstartup) // this line will work when u choose addin in addin manager 这样子,在vs的addin manager中选中插件时,插件才会重新显示出来,一般的范例中,只有前两个判断
(2)querystate中,设置state时,要使用下面语句
if( 是你加入的command ) { if( 满足显示的条件 ) status = (vscommandstatus)vscommandstatus.vscommandstatussupported|vscommandstatus.vscommandstatusenabled; else status = (vscommandstatus)vscommandstatus.vscommandstatussupported; } else status = (vscommandstatus)vscommandstatus.vscommandstatusunsupported; 这样做,才能在条件不满足时,插件的菜单变灰