DesignerActionList 类


为定义用于创建智能标记面板的项列表的类型提供基类。Provides the base class for types that define a list of items used to create a smart tag panel.

public ref class DesignerActionList
public class DesignerActionList
type DesignerActionList = class
Public Class DesignerActionList


下面的代码示例演示如何创建对象的DesignerActionItem集合。The following code example demonstrates how to create a collection of DesignerActionItem objects.

有关此代码示例的完整说明, 请参阅如何:将智能标记附加到 Windows 窗体组件For a complete explanation of this code example, see How to: Attach Smart Tags to a Windows Forms Component.

public class ColorLabelActionList :
Public Class ColorLabelActionList
    Inherits System.ComponentModel.Design.DesignerActionList


DesignerAction功能使组件和控件能够显示上下文相关信息和命令。The DesignerAction feature enables components and controls to display context-sensitive information and commands. DesignerAction功能可被视为设计器谓词的替换, DesignerActionItem因为可以显示在智能标记面板中, 也可以显示在与组件或控件关联的快捷菜单中。The DesignerAction feature can be thought of as a replacement for designer verbs, because a DesignerActionItem can be displayed in the smart tag panel and also in the shortcut menu associated with a component or control. DesignerActionList类表示要为其自定义组件和控件添加智能标记支持的开发人员的主要交互点。The DesignerActionList class represents the main point of interaction for developers who want to add smart tag support to their custom components and controls.

DesignerActionList是由组件开发人员派生的基类, 用于填充智能标记面板。DesignerActionList is the base class, derived from by component developers in order to populate a smart tag panel. 智能标记面板表示智能标记类似于菜单的用户界面 (UI)。A smart tag panel represents the menu-like user interface (UI) for smart tags.

此派生类可以实现virtual GetSortedActionItems方法以返回从DesignerActionItem派生的对象的集合。This derived class may implement the virtualGetSortedActionItems method to return a collection of objects derived from DesignerActionItem. 这些对象表示智能标记面板项。These objects represent the smart tag panel items. 每个项根据其类型显示在面板中。Each item is displayed in the panel according to its type. 例如, DesignerActionTextItem将显示为静态文本标签。For example, a DesignerActionTextItem is displayed as a static text label. DesignerActionPropertyItemDesignerActionMethodItem类型表示的活动面板项分别具有可公开访问的属性或方法, 该属性或方法可实现该项的功能。Active panel items, represented by the DesignerActionPropertyItem and DesignerActionMethodItem types, have a corresponding publicly accessible property or method, respectively, that implements the functionality for that item.

有关如何向智能标记面板中添加项的详细信息, 请参阅GetSortedActionItems方法。For more information about how to add items to the smart tag panel, see the GetSortedActionItems method.


窗体和对话框可由派生自DesignerActionList的类的成员显示。Forms and dialog boxes can be displayed by members of the class derived from DesignerActionList. 默认情况下, 这些窗口的父级将是智能标记面板的 "容器" 窗口。By default, the parent of these windows will be the container window for the smart tag panel. 将这些子窗口显式用于其他服务或窗口可能会导致智能标记无法正确显示。Explicitly parenting these child windows to another service or window may cause smart tags to display improperly.

智能标记面板不支持滚动或分页, 因此请注意不要用许多智能标记项填充面板。Smart-tag panels do not support scrolling or paging, so be careful not to populate your panels with many smart-tag items. 太多的项可能会导致智能标记面板超出屏幕边界。Too many items may result in the smart-tag panel extending beyond the screen boundary.



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



获取或设置一个值,该值表示智能标记面板在创建后是否应自动显示。Gets or sets a value indicating whether the smart tag panel should automatically be displayed when it is created.


获取与 DesignerActionList 相关的组件。Gets the component related to DesignerActionList.



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

(继承自 Object)

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

(继承自 Object)

返回一个对象,该对象表示由与 DesignerActionList 相关联的组件提供的服务。Returns an object that represents a service provided by the component associated with the DesignerActionList.


返回包含在列表中的 DesignerActionItem 对象的集合。Returns the collection of DesignerActionItem objects contained in the list.


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

(继承自 Object)

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

(继承自 Object)

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

(继承自 Object)