System.Design 2.0.0.0 System.Object System.IDisposable System.IServiceProvider

The class implements what the user perceives as a designer. is the user interface the user manipulates to change design-time features. provides a completely self-contained design surface.

The class may be used as a stand-alone designer, or it may be coupled with the class to provide a common implementation for an application that hosts multiple objects.

The class can be used by itself, or the user can derive a new class from it and augment the behavior.

The class provides several design-time services automatically. The class adds all of its services in its constructor. Most of these services can be overridden by replacing them in the protected property. To replace a service, override the constructor, call base, and make any changes through the protected property. All services that are added to the service container and that implement are disposed when the design surface is disposed. The default set of replaceable services that the class provides is shown in the following table.

Service

Description

Enables objects that are not part of the container’s components collection to provide their own extender providers.

Used by to get a list of extender providers. With this service, extender providers can live outside of the container.

Provides designer metadata hooks. This is the primary interface for metadata filtering.

Provides a way to select components in the designer.

Provides a way to get a name for objects, even when those objects are not sited.

Offers the design surface itself as a service.

Provides a base class for getting and setting option values for a designer.

The following table shows the non-replaceable services provided by default.

Service

Description

Raises events as changes are made to components.

Controls access to types, services, and transactions. Master interface for designers.

Owns the set of components that are being designed. Each designer has an that owns the components.

Derives from and provides a way to add and remove services from the designer.

In addition to these services, the class also provides a single service that is available through a component’s site. This service is unique for each component. The following table shows the services that cannot be replaced.

Service

Description

A generic dictionary of key/value pairs that can be used to store arbitrary data about a component.

A container that enables a component to add additional child components to the designer. These components will be part of the design surface, but will not participate in serialization. This is useful when you want to design a control that is capable of exposing a region of itself in a designer, but you do not want the region to participate in serialization.

In addition to , the site also implements the following interfaces.

Check for the existence of these interfaces, rather than use indiscriminate casting, because other site implementations may not implement them.

Service

Description

Provides a way to get to the container of site-specific services. For example, is a site-specific service. With this service, you can add additional site-specific services.

Presents a user interface for designing components.

- Constructor
  2.0.0.0
  To be added.

  Initializes a new instance of the class.

- Constructor
  2.0.0.0

  When is present, designers contained within the surface can retrieve services from the application.

  Initializes a new instance of the class.

  The parent service provider, or null if there is no parent used to resolve services.
- Constructor
  2.0.0.0

  When you use the constructor, it creates a simple designer loader that, in turn, creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type.

  The overload is not affected by . The must be in the service container before the design surface loads. If you need access to , call the empty constructor, add the to the and call with .

  Initializes a new instance of the class.

  The type of root component to create.
- Constructor
  2.0.0.0

  Using the constructor creates a simple designer loader that creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls and passes the root component type.

  Initializes a new instance of the class.

  The parent service provider, or null if there is no parent used to resolve services.
  The type of root component to create.
- Method
  2.0.0.0
  System.Void ``

  Designer loading can be asynchronous, so the loading may continue to progress after this call has returned. Attach an event handler to the event to be notified when the design surface has completed loading.

  After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously.

  Begins the loading process with the given designer loader.

  The designer loader to use for loading the designer.
- Method
  2.0.0.0
  System.Void ``

  When is specified, a default designer loader that simply creates an instance of will be used. Designer loading can be asynchronous, so the loading may continue to progress after this call has returned. Attach an event handler to the event to be notified when the design surface has completed loading.

  After is called, you can immediately obtain the view for the designer, because designer loaders must provide at least the root component when loading asynchronously.

  The method creates an instance of the component type and initializes a designer for this instance. The event is raised before this method returns.

  Begins the loading process.

  The type of component to create in design mode.
- Property
  2.0.0.0
  System.ComponentModel.IContainer To be added.

  The property holds all objects that are currently in design mode. When components are added to , their designer, if any, is loaded. The component is sited with a site that provides full access to the design surface.

  Gets the implementation within the design surface.

- Method
  2.0.0.0
  System.Obsolete("CreateComponent has been replaced by CreateInstance")
  System.ComponentModel.IComponent ``

  The method is called by the design surface’s method to create an instance of a component. The component should be created and added to the public container on the design surface.

  Creates an instance of a component.

  The newly created component.

  The type of component to create.
- Method
  2.0.0.0
  System.ComponentModel.Design.IDesigner `` ``

  The method is called by the design surface’s when a component is added to the container. This method creates a designer, but does not initialize it. When it returns, the designer is initialized by the container.

  can create two different types of designers: root designers and normal designers. A root designer is a designer for the root component in the design surface, which by definition is the first component added to the container. Root designers differ from normal designers because they are responsible for the user interface presented to the end user. Root designers typically coordinate with the rest of the designers on a design surface to provide this interface.

  The default implementation of this method delegates to , passing in as the designer type for root designers, or for normal designers. You can override this method to request a specific type of designer.

  Creates a designer when a component is added to the container.

  An instance of the requested designer, or null if no matching designer could be found.

  The component for which the designer should be created. true to create a root designer; false to create a normal designer.
- Method
  2.0.0.0
  System.Object ``

  If is an , searches for a constructor of type first, followed by an empty constructor.

  Creates an instance of the given type.

  The newly created object.

  The type to create.
- Method
  2.0.0.0
  System.ComponentModel.INestedContainer ``

  Adding a component to a nested container creates its designer and makes it eligible for all services available from the design surface. Components added to nested containers do not participate in serialization.

  Creates a container suitable for nesting controls or components.

  The nested container.

  The component that manages the nested container.
- Method
  2.0.0.0
  System.ComponentModel.INestedContainer `` ``

  Adding a component to a nested container creates its designer and makes it eligible for all services available from the design surface. Components added to nested containers do not participate in serialization.

  You can provide an additional name for the method by passing a value into .

  Creates a container suitable for nesting controls or components.

  The nested container.

  The component that manages the nested container. An additional name for the nested container.
- Method
  2.0.0.0
  System.Void

  The public method follows the standard pattern. Calling this method destroys the design surface. The protected version of this method is virtual and follows the normal pattern.

  Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself.

  Call when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the garbage collector can reclaim the memory that the was occupying. For more information, see Cleaning Up Unmanaged Resources and Implementing a Dispose Method.

  Always call before you release your last reference to the . Otherwise, the resources it is using will not be freed until the garbage collector calls the object's Finalize method.

  Releases the resources used by the .

- Method
  2.0.0.0
  System.Void ``

  The public method follows the standard pattern. Calling this method destroys the design surface. The protected version of this method is virtual and follows the normal pattern.

  Because does not have any native code to clean up, it does not have a finalizer that calls . If you need to call , you must add a finalizer yourself.

  This method is called by the public Dispose() method and the method. Dispose() invokes the protected Dispose(Boolean) method with the parameter set to true. invokes Dispose with set to false.

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the Dispose() method of each referenced object.

  Releases the resources used by the .

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Event
  2.0.0.0
  System.EventHandler

  The surface is only disposed when the public method on is called.

  Occurs when the design surface is disposed.

- Method
  2.0.0.0
  System.Void

  The method can be called to push changes made to the design surface down to the serializer. This ensures that the design surface and its serialized state are synchronized. The actual implementation of this method is forwarded to the designer loader associated with design surface. The designer loader may choose to defer changes until is called, or it may choose to keep the serialized data up to date with all user changes. The method ensures that regardless of the model the designer loader chooses to use, the serialized state is synchronized with the actual design surface.

  Serializes changes to the design surface.

- Event
  2.0.0.0
  System.EventHandler

  The designer loader is flushed first, and then the event is raised.

  Occurs when a call is made to the method of .

- Method
  2.0.0.0
  System.Object ``

  The method retrieves a service in the design surface’s service container. In addition, this will forward to any service provider that was given to the design surface at construction time.

  Gets a service from the service container.

  An object that implements, or is a derived class of, , or null if the service does not exist in the service container.

  The type of service to retrieve.
- Property
  2.0.0.0
  System.Boolean To be added. To be added.

  Gets a value indicating whether the design surface is currently loaded.

- Event
  2.0.0.0
  System.ComponentModel.Design.LoadedEventHandler

  The event is raised for successful loads as well as unsuccessful ones. If code in this event handler throws an exception, the designer is unloaded.

  The object can be used to determine if loading succeeded, and it can also provide a list of errors that occurred during the load.

  Errors can occur for successful loads as well, provided that the serialization system can tolerate errors.

  Occurs when the designer load has completed.

- Property
  2.0.0.0
  System.Collections.ICollection To be added. To be added.

  Returns a collection of loading errors or a void collection.

- Event
  2.0.0.0
  System.EventHandler To be added.

  Occurs when the designer is about to be loaded.

- Method
  2.0.0.0
  System.Void `` To be added.

  Raises the event.

  A that contains the event data.
- Method
  2.0.0.0
  System.Void `` To be added.

  Raises the event.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void `` To be added.

  Raises the event.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void `` To be added.

  Raises the event.

  An that contains the event data.
- Method
  2.0.0.0
  System.Void `` To be added.

  Raises the event.

  An that contains the event data.
- Property
  2.0.0.0
  System.ComponentModel.Design.ServiceContainer To be added.

  At construction time, adds default services into this service container. You can leave the default services in their present state, or you can remove them and replace them with your own. The default services are all demand-created, so there is no loss in performance for adding them at construction time.

  Gets the service container.

- Event
  2.0.0.0
  System.EventHandler To be added.

  Occurs when a designer has finished unloading.

- Event
  2.0.0.0
  System.EventHandler

  When a designer unloads, the entire state for that designer is destroyed, including the designer’s view. The view should be unparented at this time.

  Occurs when a designer is about to unload.

- Property
  2.0.0.0
  System.Object To be added.

  The method must be called beforehand to start the loading process. It is possible to return a view before the designer loader finishes loading because the root designer, which supplies the view, is the first object created by the designer loader. If a view is unavailable, raises an exception.

  The notion of a view technology is obsolete. But, it remains in the interfaces for root designers for backward compatibility. Its use is hidden from anyone using objects. The property hides view technologies by passing the supported technologies back into the root designer.

  Gets the view for the root designer.

- Event
  2.0.0.0
  System.EventHandler

  If you want to support the method, your event handler should activate the window for this design surface.

  Occurs when the method has been called on .