Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

IDesignerHost Interface

Provides an interface for managing designer transactions and components.

Namespace:  System.ComponentModel.Design
Assembly:  System (in System.dll)
[<ComVisibleAttribute(true)>]
type IDesignerHost =  
    interface 
        interface IServiceContainer 
        interface IServiceProvider 
    end

The IDesignerHost type exposes the following members.

  NameDescription
Public propertyContainerGets the container for this designer host.
Public propertyInTransactionGets a value indicating whether the designer host is currently in a transaction.
Public propertyLoadingGets a value indicating whether the designer host is currently loading the document.
Public propertyRootComponentGets the instance of the base class used as the root component for the current design.
Public propertyRootComponentClassNameGets the fully qualified name of the class being designed.
Public propertyTransactionDescriptionGets the description of the current transaction.
Top
  NameDescription
Public methodActivateActivates the designer that this host is hosting.
Public methodAddService(Type, ServiceCreatorCallback)Adds the specified service to the service container. (Inherited from IServiceContainer.)
Public methodAddService(Type, Object)Adds the specified service to the service container. (Inherited from IServiceContainer.)
Public methodAddService(Type, ServiceCreatorCallback, Boolean)Adds the specified service to the service container, and optionally promotes the service to parent service containers. (Inherited from IServiceContainer.)
Public methodAddService(Type, Object, Boolean)Adds the specified service to the service container, and optionally promotes the service to any parent service containers. (Inherited from IServiceContainer.)
Public methodCreateComponent(Type)Creates a component of the specified type and adds it to the design document.
Public methodCreateComponent(Type, String)Creates a component of the specified type and name, and adds it to the design document.
Public methodCreateTransaction()Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality.
Public methodCreateTransaction(String)Creates a DesignerTransaction that can encapsulate event sequences to improve performance and enable undo and redo support functionality, using the specified transaction description.
Public methodDestroyComponentDestroys the specified component and removes it from the designer container.
Public methodGetDesignerGets the designer instance that contains the specified component.
Public methodGetServiceGets the service object of the specified type. (Inherited from IServiceProvider.)
Public methodGetTypeGets an instance of the specified, fully qualified type name.
Public methodRemoveService(Type)Removes the specified service type from the service container. (Inherited from IServiceContainer.)
Public methodRemoveService(Type, Boolean)Removes the specified service type from the service container, and optionally promotes the service to parent service containers. (Inherited from IServiceContainer.)
Top
  NameDescription
Public eventActivatedOccurs when this designer is activated.
Public eventDeactivatedOccurs when this designer is deactivated.
Public eventLoadCompleteOccurs when this designer completes loading its document.
Public eventTransactionClosedAdds an event handler for the TransactionClosed event.
Public eventTransactionClosingAdds an event handler for the TransactionClosing event.
Public eventTransactionOpenedAdds an event handler for the TransactionOpened event.
Public eventTransactionOpeningAdds an event handler for the TransactionOpening event.
Top

IDesignerHost is an interface that works with the .NET Framework forms designer architecture to provide support for designer transaction and component management.

The .NET Framework does not provide an implementation of this interface. The interface is implemented by development tools that support designers.

Notes to Callers

To obtain an implementation of IDesignerHost from a development environment, call GetService while your component is active in design mode, passing the type of IDesignerHost to request an IDesignerHost service interface.

IDesignerHost provides the following members related to designer state:

  • The Loading property indicates whether a designer or document is being loaded.

  • The Activated event occurs when a designer is activated before display.

  • The Deactivated event occurs when a designer is deactivated.

  • The LoadComplete event occurs after a document is loaded.

  • The Activate method activates the designer.

IDesignerHost provides the following members related to managing components:

  • The Container property indicates the container for the designer host.

  • The RootComponent property indicates the base class for the root component.

  • The RootComponentClassName property indicates the name of the class of the root component.

  • The CreateComponent method creates the specified type of component.

  • The DestroyComponent method destroys the specified component.

  • The GetDesigner method gets the designer associated with a specified component.

  • The GetType method gets an instance of the type with the specified name.

IDesignerHost provides the following members related to managing transactions:

The following example code demonstrates how to obtain the IDesignerHost service interface from a designer or sited component.

No code example is currently available or this language may not be supported.

The following example code demonstrates using the IDesignerHost interface to list project components.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, 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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.