CommandSetLibrary 类

CommandSet 和 ClipboardCommandSet 的基类。 提供对当前选定、图表、窗口和服务。

此 API 不兼容 CLS。 

继承层次结构

System.Object
  System.MarshalByRefObject
    Microsoft.VisualStudio.Modeling.Shell.CommandSetLibrary
      Microsoft.VisualStudio.Modeling.Shell.ClipboardCommandSet
      Microsoft.VisualStudio.Modeling.Shell.CommandSet

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

语法

声明
<CLSCompliantAttribute(False)> _
Public MustInherit Class CommandSetLibrary _
    Inherits MarshalByRefObject
[CLSCompliantAttribute(false)]
public abstract class CommandSetLibrary : MarshalByRefObject

CommandSetLibrary 类型公开以下成员。

构造函数

  名称 说明
受保护的方法 CommandSetLibrary 创建一个新 CommandSetLibrary。

页首

属性

  名称 说明
受保护的属性 CurrentDocData
受保护的属性 CurrentDocumentSelection
受保护的属性 CurrentModelingDocView
受保护的属性 CurrentSelection
受保护的属性 MenuService
受保护的属性 MonitorSelection
受保护的属性 ServiceProvider
受保护的属性 SingleDocumentSelection
受保护的属性 SingleSelection

页首

方法

  名称 说明
受保护的方法 CanDeleteSelectedItems 如果选择的项目可删除,则返回 true。
公共方法 CreateObjRef 安全关键。创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。 (继承自 MarshalByRefObject。)
受保护的方法 DeleteSelectedItems 删除选定项。
公共方法 Equals 确定指定的对象是否等于当前对象。 (继承自 Object。)
受保护的方法 Finalize 允许对象在“垃圾回收”回收之前尝试释放资源并执行其他清理操作。 (继承自 Object。)
公共方法 GetHashCode 作为默认哈希函数。 (继承自 Object。)
公共方法 GetLifetimeService 安全关键。检索控制此实例的生存期策略的当前生存期服务对象。 (继承自 MarshalByRefObject。)
受保护的方法 GetMenuCommands 定义菜单命令列表中的 CommandSet 实现。
公共方法 GetType 获取当前实例的 Type。 (继承自 Object。)
公共方法 Initialize 初始化命令集。调用 GetMenuCommands 并缓存该结果。
公共方法 InitializeLifetimeService 安全关键。获取控制此实例的生存期策略的生存期服务对象。 (继承自 MarshalByRefObject。)
受保护的方法 IsAnyDocumentSelectionCompartment 如果任何一个在选择列表中的项是隔离舱,则为 true。
受保护的方法 IsAnyDocumentSelectionMoveableHostShape 如果任何一个在选择列表中的项是不能删除的可移动主机形状则为 true。
受保护的方法 IsAnyDocumentSelectionUndeletable 如果任何一个在选择列表中的形状项不能删除,则为 true。
受保护的方法 IsCurrentDiagramEmpty 如果图形没有子项,则为 true。
受保护的方法 IsDiagramSelected 如果选中该图形,则为 true。
受保护的方法 IsSingleDocumentSelection 如果只有在活动文档选择的项目,则为 true。
受保护的方法 IsSingleSelection 如果只有在活动文档窗口或工具窗口选择的项目,则为 true。
受保护的方法 MemberwiseClone() 创建当前 Object 的浅表副本。 (继承自 Object。)
受保护的方法 MemberwiseClone(Boolean) 创建当前 MarshalByRefObject 对象的浅表副本。 (继承自 MarshalByRefObject。)
公共方法 ToString 返回表示当前对象的字符串。 (继承自 Object。)

页首

备注

有关详细信息,请参阅如何:向快捷菜单中添加命令

线程安全

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

请参阅

参考

Microsoft.VisualStudio.Modeling.Shell 命名空间