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.
class System.​ComponentModel.​Design.​ServiceContainer
Assembly: System.ComponentModel.TypeConverter
Inheritance: object → ServiceContainer
Implemented Interfaces
- IServiceContainer (Inherits: IServiceProvider)
- IDisposable
Provides a simple implementation of the <see cref="T:System.ComponentModel.Design.IServiceContainer" /> interface. This class cannot be inherited.
Properties
protected
Type[]
DefaultServices
Gets the default services implemented directly by <see cref="T:System.ComponentModel.Design.ServiceContainer" /> .
Methods
public
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 can create the service. This allows a service to be declared as available, but delays creation of the object until the service is requested.
public
void
AddService​(Type serviceType,
ServiceCreatorCallback callback,
bool promote)
Adds the specified service to the service container.
serviceType
The type of service to add.
callback
A callback object that can create the service. This allows a service to be declared as available, but delays creation of the object until the service is requested.
promote
<see langword="true" /> if this service should be added to any parent service containers; otherwise, <see langword="false" /> .
public
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 to add. This object must implement or inherit from the type indicated by the <paramref name="serviceType" /> parameter.
public
void
AddService​(Type serviceType,
object serviceInstance,
bool promote)
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.
promote
<see langword="true" /> if this service should be added to any parent service containers; otherwise, <see langword="false" /> .
public
void
Dispose​()
Disposes this service container.
protected
void
Dispose​(bool disposing)
Disposes this service container.
disposing
<see langword="true" /> if the <see cref="T:System.ComponentModel.Design.ServiceContainer" /> is in the process of being disposed of; otherwise, <see langword="false" /> .
Returns An instance of the service if it could be found, or <see langword="null" /> if it could not be found.
serviceType
The type of service to retrieve.
public
void
RemoveService​(Type serviceType)
Removes the specified service type from the service container.
serviceType
The type of service to remove.
public
void
RemoveService​(Type serviceType,
bool promote)
Removes the specified service type from the service container.
serviceType
The type of service to remove.
promote
<see langword="true" /> if this service should be removed from any parent service containers; otherwise, <see langword="false" /> .
public
bool
Equals​(object obj)
Inherited from object
protected
void
Finalize​()
Inherited from object
public
int
GetHashCode​()
Inherited from object
protected
object
MemberwiseClone​()
Inherited from object
public
string
ToString​()
Inherited from object