ServiceCreatorCallback Delegate
Provides a callback mechanism that can create an instance of a service on demand.
Assembly: System (in System.dll)
[<ComVisibleAttribute(true)>] [<HostProtectionAttribute(SecurityAction.LinkDemand, SharedState = true)>] type ServiceCreatorCallback = delegate of container:IServiceContainer * serviceType:Type -> Object
Parameters
- container
-
Type:
System.ComponentModel.Design.IServiceContainer
The service container that requested the creation of the service.
- serviceType
-
Type:
System.Type
The type of service to create.
Return Value
Type: System.ObjectThe service specified by serviceType, or null if the service could not be created.
ServiceCreatorCallback provides a mechanism to publish services that you can request to have created when needed, rather than the service being created immediately when the designer loads. You can use a callback function if the service is not essential and may not be used. A service published by using a ServiceCreatorCallback does not use as many additional resources if it is not requested and created. To use a callback function to publish your service, pass a ServiceCreatorCallback to the AddService method of an IServiceContainer.
Available since 1.1