DesignSurfaceManager.CreateDesignSurface Method (IServiceProvider)


Creates an instance of a design surface.

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

public DesignSurface CreateDesignSurface(
	IServiceProvider parentProvider


Type: System.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 method.

Return Value

Type: System.ComponentModel.Design.DesignSurface

A new design surface instance.

Exception Condition

parentProvider is null.

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.

.NET Framework
Available since 2.0
Return to top