Редагувати

Поділитися через


DesignSurface Constructors

Definition

Initializes a new instance of the DesignSurface class.

Overloads

DesignSurface()

Initializes a new instance of the DesignSurface class.

DesignSurface(IServiceProvider)

Initializes a new instance of the DesignSurface class.

DesignSurface(Type)

Initializes a new instance of the DesignSurface class.

DesignSurface(IServiceProvider, Type)

Initializes a new instance of the DesignSurface class.

DesignSurface()

Initializes a new instance of the DesignSurface class.

public:
 DesignSurface();
public DesignSurface ();
Public Sub New ()

Exceptions

The IDesignerHost attached to the DesignSurface has been disposed.

Applies to

DesignSurface(IServiceProvider)

Initializes a new instance of the DesignSurface class.

public:
 DesignSurface(IServiceProvider ^ parentProvider);
public DesignSurface (IServiceProvider parentProvider);
public DesignSurface (IServiceProvider? parentProvider);
new System.ComponentModel.Design.DesignSurface : IServiceProvider -> System.ComponentModel.Design.DesignSurface
Public Sub New (parentProvider As IServiceProvider)

Parameters

parentProvider
IServiceProvider

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

Exceptions

The IDesignerHost attached to the DesignSurface has been disposed.

Remarks

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

See also

Applies to

DesignSurface(Type)

Initializes a new instance of the DesignSurface class.

public:
 DesignSurface(Type ^ rootComponentType);
public DesignSurface (Type rootComponentType);
new System.ComponentModel.Design.DesignSurface : Type -> System.ComponentModel.Design.DesignSurface
Public Sub New (rootComponentType As Type)

Parameters

rootComponentType
Type

The type of root component to create.

Exceptions

rootComponent is null.

The IDesignerHost attached to the DesignSurface has been disposed.

Remarks

When you use the DesignSurface 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 BeginLoad and passes the root component type.

Note

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

Applies to

DesignSurface(IServiceProvider, Type)

Initializes a new instance of the DesignSurface class.

public:
 DesignSurface(IServiceProvider ^ parentProvider, Type ^ rootComponentType);
public DesignSurface (IServiceProvider parentProvider, Type rootComponentType);
public DesignSurface (IServiceProvider? parentProvider, Type rootComponentType);
new System.ComponentModel.Design.DesignSurface : IServiceProvider * Type -> System.ComponentModel.Design.DesignSurface
Public Sub New (parentProvider As IServiceProvider, rootComponentType As Type)

Parameters

parentProvider
IServiceProvider

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

rootComponentType
Type

The type of root component to create.

Exceptions

rootComponent is null.

The IDesignerHost attached to the DesignSurface has been disposed.

Remarks

Using the DesignSurface 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 BeginLoad and passes the root component type.

See also

Applies to