CommandContextBoundMenuCommand 类

表示绑定到特定 UI 上下文的菜单命令。

此 API 不兼容 CLS。 

继承层次结构

System.Object
  System.ComponentModel.Design.MenuCommand
    Microsoft.VisualStudio.Shell.OleMenuCommand
      Microsoft.VisualStudio.Modeling.Shell.CommandContextBoundMenuCommand

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

语法

声明
<CLSCompliantAttribute(False)> _
Public Class CommandContextBoundMenuCommand _
    Inherits OleMenuCommand
[CLSCompliantAttribute(false)]
public class CommandContextBoundMenuCommand : OleMenuCommand

CommandContextBoundMenuCommand 类型公开以下成员。

构造函数

  名称 说明
公共方法 CommandContextBoundMenuCommand 初始化 CommandContextBoundMenuCommand 类的新实例。

页首

属性

  名称 说明
公共属性 Checked 获取或设置一个值,用以指示是否选中此菜单项。 (继承自 MenuCommand。)
公共属性 CommandID 获取与此菜单命令相关联的 CommandID。 (继承自 MenuCommand。)
公共属性 Enabled 获取一个值,该值指示此菜单项是否可用。 (继承自 MenuCommand。)
公共属性 MatchedCommandId (继承自 OleMenuCommand。)
公共属性 OleStatus (继承自 OleMenuCommand。)
公共属性 ParametersDescription (继承自 OleMenuCommand。)
公共属性 Properties 获取与 MenuCommand 关联的公共属性。 (继承自 MenuCommand。)
公共属性 Supported 获取或设置一个值,用以指示是否支持此菜单项。 (继承自 MenuCommand。)
公共属性 Text (继承自 OleMenuCommand。)
公共属性 Visible 获取或设置一个值,用以指示此菜单项是否可见。 (继承自 MenuCommand。)

页首

方法

  名称 说明
公共方法 DynamicItemMatch (继承自 OleMenuCommand。)
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetHashCode 用作特定类型的哈希函数。 (继承自 Object。)
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 Invoke() 调用该命令。 (继承自 MenuCommand。)
公共方法 Invoke(Object) (继承自 OleMenuCommand。)
公共方法 Invoke(Object, IntPtr) (继承自 OleMenuCommand。)
公共方法 Invoke(Object, IntPtr, OLECMDEXECOPT) (继承自 OleMenuCommand。)
受保护的方法 MemberwiseClone 创建当前 Object 的浅表副本。 (继承自 Object。)
受保护的方法 OnCommandChanged 引发 CommandChanged 事件。 (继承自 MenuCommand。)
公共方法 ToString 返回此菜单命令的字符串表示形式。 (继承自 MenuCommand。)

页首

事件

  名称 说明
公共事件 BeforeQueryStatus (继承自 OleMenuCommand。)
公共事件 CommandChanged 在菜单命令出现更改时发生。 (继承自 MenuCommand。)

页首

备注

,仅在其用户界面上下文处于活动状态时,命令可见。

在 Commands.vstc 文件的 VISIBILITY_SECTION 应使用项的命令。 在域特定语言设计器,可以找到 Commands.vstc 文件在 DslPackage 节点下。

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。但不保证所有实例成员都是线程安全的。

请参见

参考

Microsoft.VisualStudio.Modeling.Shell 命名空间