DesignSurface Class
TOC
Collapse the table of content
Expand the table of content

DesignSurface Class

 

Presents a user interface for designing components.

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

System.Object
  System.ComponentModel.Design.DesignSurface

[SecurityCriticalAttribute]
[PermissionSetAttribute(SecurityAction.InheritanceDemand, Name = "FullTrust")]
public class DesignSurface : IDisposable, IServiceProvider

NameDescription
System_CAPS_pubmethodDesignSurface()

Initializes a new instance of the DesignSurface class.

System_CAPS_pubmethodDesignSurface(IServiceProvider)

Initializes a new instance of the DesignSurface class.

System_CAPS_pubmethodDesignSurface(IServiceProvider, Type)

Initializes a new instance of the DesignSurface class.

System_CAPS_pubmethodDesignSurface(Type)

Initializes a new instance of the DesignSurface class.

NameDescription
System_CAPS_pubpropertyComponentContainer

Gets the IContainer implementation within the design surface.

System_CAPS_pubpropertyDtelLoading

Gets a value indicating whether the Design-time Error List is loading.

System_CAPS_pubpropertyIsLoaded

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

System_CAPS_pubpropertyLoadErrors

Returns a collection of loading errors or a void collection.

System_CAPS_protpropertyServiceContainer

Gets the service container.

System_CAPS_pubpropertyView

Gets the view for the root designer.

NameDescription
System_CAPS_pubmethodBeginLoad(DesignerLoader)

Begins the loading process with the given designer loader.

System_CAPS_pubmethodBeginLoad(Type)

Begins the loading process.

System_CAPS_protmethodCreateComponent(Type)

Obsolete.Creates an instance of a component.

System_CAPS_protmethodCreateDesigner(IComponent, Boolean)

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

System_CAPS_protmethodCreateInstance(Type)

Creates an instance of the given type.

System_CAPS_pubmethodCreateNestedContainer(IComponent)

Creates a container suitable for nesting controls or components.

System_CAPS_pubmethodCreateNestedContainer(IComponent, String)

Creates a container suitable for nesting controls or components.

System_CAPS_pubmethodDispose()

Releases the resources used by the DesignSurface.

System_CAPS_protmethodDispose(Boolean)

Releases the resources used by the DesignSurface.

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodFlush()

Serializes changes to the design surface.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetService(Type)

Gets a service from the service container.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodOnLoaded(LoadedEventArgs)

Raises the Loaded event.

System_CAPS_protmethodOnLoading(EventArgs)

Raises the Loading event.

System_CAPS_protmethodOnUnloaded(EventArgs)

Raises the Unloaded event.

System_CAPS_protmethodOnUnloading(EventArgs)

Raises the Unloading event.

System_CAPS_protmethodOnViewActivate(EventArgs)

Raises the ViewActivated event.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubeventDisposed

Occurs when the design surface is disposed.

System_CAPS_pubeventFlushed

Occurs when a call is made to the Flush method of DesignSurface.

System_CAPS_pubeventLoaded

Occurs when the designer load has completed.

System_CAPS_pubeventLoading

Occurs when the designer is about to be loaded.

System_CAPS_pubeventUnloaded

Occurs when a designer has finished unloading.

System_CAPS_pubeventUnloading

Occurs when a designer is about to unload.

System_CAPS_pubeventViewActivated

Occurs when the Activate method has been called on IDesignerHost.

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

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

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

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

Service

Description

IExtenderProviderService

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

IExtenderListService

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

ITypeDescriptorFilterService

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

ISelectionService

Provides a way to select components in the designer.

IReferenceService

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

DesignSurface

Offers the design surface itself as a service.

DesignerOptionService

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

IComponentChangeService

Raises events as changes are made to components.

IDesignerHost

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

IContainer

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

IServiceContainer

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

In addition to these services, the DesignSurface 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

IDictionaryService

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

INestedContainer

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 ISite, the site also implements the following interfaces.

System_CAPS_cautionCaution

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

Service

Description

IServiceContainer

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

NamedPermissionSet

for full access to system resources. Demand values: LinkDemand, InheritanceDemand. Associated state:

.NET Framework
Available since 2.0

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

Return to top
Show:
© 2016 Microsoft