IVsMonitorSelection.IsCmdUIContextActive 方法

确定特定命令 UI 上下文是否处于活动状态。

命名空间:  Microsoft.VisualStudio.Shell.Interop
程序集:  Microsoft.VisualStudio.Shell.Interop(在 Microsoft.VisualStudio.Shell.Interop.dll 中)

语法

声明
Function IsCmdUIContextActive ( _
    dwCmdUICookie As UInteger, _
    <OutAttribute> ByRef pfActive As Integer _
) As Integer
int IsCmdUIContextActive(
    uint dwCmdUICookie,
    out int pfActive
)

参数

  • pfActive
    类型:System.Int32%
    [out] ,如果 dwCmdUICookie 确定的命令 UI 上下文否则,为活动状态和 false 标记将设置为 true 。

返回值

类型:System.Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 vsshell.idl:

HRESULT IVsMonitorSelection::IsCmdUIContextActive(
   [in]  VSCOOKIE  dwCmdUICookie,
   [out] BOOL     *pfActive
);

命令 UI 上下文是在 GUID 和影响 UI 的命令之间的关联。它是由 SVsShellMonitorSelection 服务监视并由 Vspackage 根据需要设置。为命令 UI 上下文的典型用法是激活特定模式 (如设计模式或调试模式和选择性显示工具栏或菜单命令。若要切换命令 UI 上下文的状态,请调用 SetCmdUIContext

.NET Framework 安全性

请参见

参考

IVsMonitorSelection 接口

Microsoft.VisualStudio.Shell.Interop 命名空间