Connection.IServiceContainer.AddService Method

Definition

Adds the specified service to the service container.

Overloads

IServiceContainer.AddService(Type, ServiceCreatorCallback)

Adds the service that has the specified callback object to the service container.

IServiceContainer.AddService(Type, Object)

Adds the service that has the specified service type instance to the service container.

IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

Adds the service that has the specified callback object to the service container, optionally promoting the request to any parent service containers.

IServiceContainer.AddService(Type, Object, Boolean)

Adds the service that has the specified service type instance to the service container, optionally promoting the request to any parent service containers.

IServiceContainer.AddService(Type, ServiceCreatorCallback)

Adds the service that has the specified callback object to the service container.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::ComponentModel::Design::ServiceCreatorCallback ^ callback) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, System.ComponentModel.Design.ServiceCreatorCallback callback);
Sub AddService (serviceType As Type, callback As ServiceCreatorCallback) Implements IServiceContainer.AddService

Parameters

serviceType
Type

The type of service to add.

callback
ServiceCreatorCallback

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.

Implements

Applies to

IServiceContainer.AddService(Type, Object)

Adds the service that has the specified service type instance to the service container.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::Object ^ serviceInstance) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, object serviceInstance);
Sub AddService (serviceType As Type, serviceInstance As Object) Implements IServiceContainer.AddService

Parameters

serviceType
Type

The type of service to add.

serviceInstance
Object

An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter.

Implements

Applies to

IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

Adds the service that has the specified callback object to the service container, optionally promoting the request to any parent service containers.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::ComponentModel::Design::ServiceCreatorCallback ^ callback, bool promote) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, System.ComponentModel.Design.ServiceCreatorCallback callback, bool promote);
Sub AddService (serviceType As Type, callback As ServiceCreatorCallback, promote As Boolean) Implements IServiceContainer.AddService

Parameters

serviceType
Type

The type of service to add.

callback
ServiceCreatorCallback

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
Boolean

true to promote this request to any parent service containers; otherwise, false.

Implements

Applies to

IServiceContainer.AddService(Type, Object, Boolean)

Adds the service that has the specified service type instance to the service container, optionally promoting the request to any parent service containers.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::Object ^ serviceInstance, bool promote) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, object serviceInstance, bool promote);
Sub AddService (serviceType As Type, serviceInstance As Object, promote As Boolean) Implements IServiceContainer.AddService

Parameters

serviceType
Type

The type of service to add.

serviceInstance
Object

An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter.

promote
Boolean

true to promote this request to any parent service containers; otherwise, false.

Implements

Applies to