Edit

Share via


DesignSurfaceManager.CreateDesignSurface Method

Definition

Creates an instance of a design surface.

Overloads

CreateDesignSurface()

Creates an instance of a design surface.

CreateDesignSurface(IServiceProvider)

Creates an instance of a design surface.

CreateDesignSurface()

Creates an instance of a design surface.

public:
 System::ComponentModel::Design::DesignSurface ^ CreateDesignSurface();
public System.ComponentModel.Design.DesignSurface CreateDesignSurface ();
member this.CreateDesignSurface : unit -> System.ComponentModel.Design.DesignSurface
Public Function CreateDesignSurface () As DesignSurface

Returns

A new design surface instance.

See also

Applies to

CreateDesignSurface(IServiceProvider)

Creates an instance of a design surface.

public:
 System::ComponentModel::Design::DesignSurface ^ CreateDesignSurface(IServiceProvider ^ parentProvider);
public System.ComponentModel.Design.DesignSurface CreateDesignSurface (IServiceProvider parentProvider);
member this.CreateDesignSurface : IServiceProvider -> System.ComponentModel.Design.DesignSurface
Public Function CreateDesignSurface (parentProvider As IServiceProvider) As DesignSurface

Parameters

parentProvider
IServiceProvider

A parent service provider. A new merged service provider will be created that will first ask this provider for a service, and then delegate any failures to the design surface manager object. This merged provider will be passed into the CreateDesignSurfaceCore(IServiceProvider) method.

Returns

A new design surface instance.

Exceptions

parentProvider is null.

Remarks

If you want to conveniently add additional per-designer services, use the parentProvider parameter to provide a service provider for this design surface. The CreateDesignSurface method creates a merged service provider that can satisfy service requests from both the given service provider as well as the DesignSurfaceManager itself. The CreateDesignSurface method then passes this service provider into the CreateDesignSurfaceCore method.

After CreateDesignSurfaceCore returns the design surface, the CreateDesignSurface method tries to obtain the IDesignerEventService. If it is present, and if it is the instance of the service that DesignSurfaceManager provided by default, the CreateDesignSurface method raises the DesignerCreated event.

Notes to Inheritors

If an external implementation of the service was provided, it is the responsibility of the class that derives from the DesignSurfaceManager class to raise the DesignerCreated event.

See also

Applies to