Export (0) Print
Expand All

DesignerActionService Class

Establishes a design-time service that manages the collection of DesignerActionItem objects for components.

System.Object
  System.ComponentModel.Design.DesignerActionService
    System.Web.UI.Design.WebFormsDesignerActionService

Namespace:  System.ComponentModel.Design
Assembly:  System.Design (in System.Design.dll)

public class DesignerActionService : IDisposable

The DesignerActionService type exposes the following members.

  NameDescription
Public methodDesignerActionServiceInitializes a new instance of the DesignerActionService class.
Top

  NameDescription
Public methodAdd(IComponent, DesignerActionList)Adds a DesignerActionList to the current collection of managed smart tags.
Public methodAdd(IComponent, DesignerActionListCollection)Adds a DesignerActionListCollection to the current collection of managed smart tags.
Public methodClearReleases all components from management and clears all push-model smart tag lists.
Public methodContainsDetermines whether the current smart tag service manages the action lists for the specified component.
Public methodDispose()Releases all resources used by the DesignerActionService class.
Protected methodDispose(Boolean)Releases the unmanaged resources used by the DesignerActionService and optionally releases the managed resources.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetComponentActions(IComponent)Returns the collection of smart tag item lists associated with a component.
Public methodGetComponentActions(IComponent, ComponentActionsType)Returns the collection of smart tag item lists of the specified type associated with a component.
Protected methodGetComponentDesignerActionsRetrieves the pull-model smart tags associated with a component.
Protected methodGetComponentServiceActionsRetrieves the push-model smart tags associated with a component.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodRemove(DesignerActionList)Removes the specified smart tag list from all components managed by the current service.
Public methodRemove(IComponent)Removes all the smart tag lists associated with the specified component.
Public methodRemove(IComponent, DesignerActionList)Removes the specified smart tag list from the specified component.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventDesignerActionListsChangedOccurs when a DesignerActionList is removed or added for any component.
Top

The 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.

NoteNote

The DesignerActionService is actually the driving service behind both the push and pull models; however, in the latter case it operates implicitly.

DesignerActionService provides a straightforward interface for accessing and manipulating the items for each component, including the following methods and events:

  • The Contains method determines whether the DesignerActionService is currently managing a particular component.

  • The GetComponentActions method supports the enumeration of the lists of items.

  • The Add method allows adding a DesignerActionList or DesignerActionListCollection to the set of existing items for a component instance. In contrast, the Remove method removes one or all of the item lists associated with a component.

    NoteNote

    The Add method represents the direct push model of associating panel items with a component. In contrast, the pull model relies on overriding the ActionLists property of the designer class for that component. The design environment is responsible for adding these items into the current DesignerActionService when a component is created on the design surface.

    Important noteImportant

    The Add, Remove, Contains, and Clear methods only consider or affect push-model items.

  • The DesignerActionListsChanged event indicates when the collection of items changes for a component.

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.

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. 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.

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.

Use the DesignerActionUIService to control the display of your designer's ActionLists.

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft