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
繼承
DesignerActionService
衍生
實作

備註

類別負責管理元件之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. 例如, 您可以根據使用者的使用內容和元件的設計階段狀態來改變面板命令。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.

使用來控制設計工具的顯示ActionListsDesignerActionUIServiceUse the DesignerActionUIService to control the display of your designer's ActionLists.

建構函式

DesignerActionService(IServiceProvider)

初始化 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.

Clear()

釋放管理的所有元件並清除所有推入模型智慧標籤清單。Releases all components from management and clears all push-model smart tag lists.

Contains(IComponent)

決定目前智慧標籤服務是否為指定元件管理動作清單。Determines whether the current smart tag service manages the action lists for the specified component.

Dispose()

釋放 DesignerActionService 類別所使用的所有資源。Releases all resources used by the DesignerActionService class.

Dispose(Boolean)

釋放 DesignerActionService 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources used by the DesignerActionService and optionally releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetComponentActions(IComponent)

傳回與元件相關聯的智慧標籤項目清單集合。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.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
Remove(DesignerActionList)

移除目前服務管理之所有元件的指定智慧標籤清單。Removes the specified smart tag list from all components managed by the current service.

Remove(IComponent)

移除與指定元件相關聯的所有智慧標籤清單。Removes all the smart tag lists associated with the specified component.

Remove(IComponent, DesignerActionList)

從指定的元件移除指定的智慧標籤清單。Removes the specified smart tag list from the specified component.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

事件

DesignerActionListsChanged

發生於移除或加入任何元件的 DesignerActionList 時。Occurs when a DesignerActionList is removed or added for any component.

適用於

另請參閱