IVsSelectionEvents.OnCmdUIContextChanged 方法

命令 UI 上下文已更改的报表。

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

语法

声明
Function OnCmdUIContextChanged ( _
    dwCmdUICookie As UInteger, _
    fActive As Integer _
) As Integer
int OnCmdUIContextChanged(
    uint dwCmdUICookie,
    int fActive
)

参数

  • dwCmdUICookie
    类型:System.UInt32
    [in] 标识命令 UI 上下文的 GUID 的 DWORD 表示已通过调用中作为 rguidCmdUI 参数传递给 GetCmdUIContextCookie
  • fActive
    类型:System.Int32
    [in] 标记设置为 true ,如果 dwCmdUICookie 确定的命令 UI 上下文具有成为活动和 false ,如果它成为非活动。

返回值

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

备注

COM 签名

从 vsshell.idl:

HRESULT IVsSelectionEvents::OnCmdUIContextChanged(
   [in] VSCOOKIE dwCmdUICookie,
   [in] BOOL fActive
);

此方法由环境调用以通知注册的 Vspackage 命令 UI 上下文从布尔值更改为,反之亦然。命令 UI 上下文中监视在全局级别由 SVsShellMonitorSelection 服务。例如,那么,当命令 UI 上下文用于打开调试模式,环境通过调用 IVsSelectionEvents::OnCmdUIContextChanged通知此更改任何注册的 Vspackage 在架构中的。

.NET Framework 安全性

请参见

参考

IVsSelectionEvents 接口

Microsoft.VisualStudio.Shell.Interop 命名空间