Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface System.​ComponentModel.​Design.​IServiceContainer
Assembly: System.ComponentModel.TypeConverter
Implemented Interfaces
Provides a container for services.
Methods
void
AddService​(Type serviceType,
ServiceCreatorCallback callback)
Adds the specified service to the service container.
serviceType
The type of service to add.
callback
A callback object that is used to create the service. This allows a service to be declared as available, but delays the creation of the object until the service is requested.
void
AddService​(Type serviceType,
ServiceCreatorCallback callback,
bool promote)
Adds the specified service to the service container, and optionally promotes the service to parent service containers.
serviceType
The type of service to add.
callback
A callback object that is used to create the service. This allows a service to be declared as available, but delays the creation of the object until the service is requested.
promote
<see langword="true" /> to promote this request to any parent service containers; otherwise, <see langword="false" /> .
void
AddService​(Type serviceType,
object serviceInstance)
Adds the specified service to the service container.
serviceType
The type of service to add.
serviceInstance
An instance of the service type to add. This object must implement or inherit from the type indicated by the <paramref name="serviceType" /> parameter.
void
AddService​(Type serviceType,
object serviceInstance,
bool promote)
Adds the specified service to the service container, and optionally promotes the service to any parent service containers.
serviceType
The type of service to add.
serviceInstance
An instance of the service type to add. This object must implement or inherit from the type indicated by the <paramref name="serviceType" /> parameter.
promote
<see langword="true" /> to promote this request to any parent service containers; otherwise, <see langword="false" /> .
void
RemoveService​(Type serviceType)
Removes the specified service type from the service container.
serviceType
The type of service to remove.
void
RemoveService​(Type serviceType,
bool promote)
Removes the specified service type from the service container, and optionally promotes the service to parent service containers.
serviceType
The type of service to remove.
promote
<see langword="true" /> to promote this request to any parent service containers; otherwise, <see langword="false" /> .