In a Visual Studio Add-In, how to disable menu items during a build? -
when write vs addin proffers menu items vs, calls querystatus
implementation check whether menu items should visible, enabled, etc.
my menu items not appropriate run during situations, e.g. when build happening. how detect whether there's build running?
you're looking vsshellutilities.issolutionbuilding
method. example of using can found managed package framework visual studio 2010 (mpfproj10) in projectnode
class:
protected internal virtual bool iscurrentstateasuppresscommandsmode() { if (vsshellutilities.issolutionbuilding(this.site)) { return true; } dbgmode dbgmode = vsshellutilities.getdebugmode(this.site) & ~dbgmode.dbgmode_encmask; if (dbgmode == dbgmode.dbgmode_run || dbgmode == dbgmode.dbgmode_break) { return true; } return false; }
Comments
Post a Comment