DesignerActionService 类


建立管理组件的 DesignerActionItem 对象集合的设计时服务。Establishes a design-time service that manages the collection of DesignerActionItem objects for components.

public ref class DesignerActionService : IDisposable
public class DesignerActionService : IDisposable
type DesignerActionService = class
    interface IDisposable
Public Class DesignerActionService
Implements IDisposable


类负责管理设计时窗体上存在DesignerActionItem的每个组件实例的对象集合。 DesignerActionServiceThe DesignerActionService class is responsible for managing the collection of DesignerActionItem objects for each instance of a component that exists on a form at design time. 此类启用项创建的直接推送模型, 主要供设计时工具开发人员使用, 不过它也可以由组件和自定义控件开发人员使用。This class enables a direct push model of item creation, and is primarily intended for use by design-time tool developers, although it can also be used by component and custom control developers.

设计时工具开发人员需要确定要为组件显示的项的列表, 并确定此列表的更改时间。Design-time tool developers will need to determine the list of items to display for a component and determine when this list changes. 他们还可以创建与智能标记面板对象结合运行的外接程序。They may also create add-ins that operate in conjunction with smart tag panel objects.

高级组件开发人员可能需要动态控制与组件关联的项, 从而替换或补充标准请求模型。Advanced component developers may need to dynamically control the items associated with a component, thus replacing or supplementing the standard pull model. 例如, 可以根据其使用情况和组件的设计时状态更改 panel 命令。For example, panel commands can be altered depending on the context of their use and the design-time state of the component.


实际上DesignerActionService是推送和请求模型后面的驱动服务; 但是, 在后一种情况下, 它将隐式操作。The DesignerActionService is actually the driving service behind both the push and pull models; however, in the latter case it operates implicitly.

DesignerActionService提供了一个简单接口, 用于访问和操作每个组件的项 (包括以下方法和事件):DesignerActionService provides a straightforward interface for accessing and manipulating the items for each component, including the following methods and events:

由于通常需要在组件的设计时快捷菜单及其面板中使用一些相同的面板项, 因此对象和设计器谓词之间DesignerActionItem存在很大的互操作性。Because it is often desirable to use some of the same panel items in both the component's design-time shortcut menu and its panel, a large degree of interoperability exists between DesignerActionItem objects and designer verbs.

如果组件设计器未显式指定 (即DesignerActionList它不包含重写ActionLists的属性), 则将从现有设计器谓词创建一个列表。If a component designer does not explicitly specify a DesignerActionList (that is, it does not contain an overridden ActionLists property), then a list will be created from existing designer verbs. 这些谓词由Verbs属性指定。These verbs are specified by the Verbs property. 在这种情况下, 内部谓词列表类用于包含谓词项面板项的集合。In this case, an internal verb list class is used to contain the collection of verb item panel entries.

如果希望DesignerActionMethodItem将同时用作面板条目和设计时快捷菜单项, 则可以在项的构造函数中includeAsDesignerVerb设置参数。If you want a DesignerActionMethodItem to be used both as a panel entry and a design-time shortcut menu entry, then you can set the includeAsDesignerVerb parameter in the item's constructor.

使用控制设计器的ActionLists显示。 DesignerActionUIServiceUse the DesignerActionUIService to control the display of your designer's ActionLists.



初始化 DesignerActionService 类的新实例。Initializes a new instance of the DesignerActionService class.


Add(IComponent, DesignerActionList)

DesignerActionList 添加到当前的托管智能标记集合。Adds a DesignerActionList to the current collection of managed smart tags.

Add(IComponent, DesignerActionListCollection)

DesignerActionListCollection 添加到当前的托管智能标记集合。Adds a DesignerActionListCollection to the current collection of managed smart tags.


解除所有组件的管理,并清除所有推模型智能标记列表。Releases all components from management and clears all push-model smart tag lists.


确定当前智能标记服务是否管理指定组件的操作列表。Determines whether the current smart tag service manages the action lists for the specified component.


释放 DesignerActionService 类使用的所有资源。Releases all resources used by the DesignerActionService class.


释放由 DesignerActionService 占用的非托管资源,还可以另外再释放托管资源。Releases the unmanaged resources used by the DesignerActionService and optionally releases the managed resources.


确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)

返回与某个组件关联的智能标记项列表的集合。Returns the collection of smart tag item lists associated with a component.

GetComponentActions(IComponent, ComponentActionsType)

返回与某个组件关联的指定类型的智能标记项列表的集合。Returns the collection of smart tag item lists of the specified type associated with a component.

GetComponentActions(IComponent, ComponentActionsType)
GetComponentDesignerActions(IComponent, DesignerActionListCollection)

检索与组件关联的拉模型智能标记。Retrieves the pull-model smart tags associated with a component.

GetComponentServiceActions(IComponent, DesignerActionListCollection)

检索与组件关联的推模型智能标记。Retrieves the push-model smart tags associated with a component.


用作默认哈希函数。Serves as the default hash function.

(继承自 Object)

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)

从由当前服务管理的所有组件中移除指定的智能标记列表。Removes the specified smart tag list from all components managed by the current service.


移除与指定组件关联的所有智能标记列表。Removes all the smart tag lists associated with the specified component.

Remove(IComponent, DesignerActionList)

从指定的组件移除指定的智能标记列表。Removes the specified smart tag list from the specified component.


返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)



为任何组件移除或添加 DesignerActionList 时发生。Occurs when a DesignerActionList is removed or added for any component.