Partager via


Package.IServiceContainer.AddService Method

Definition

Overloads

IServiceContainer.AddService(Type, ServiceCreatorCallback)

Adds the given service to the VSPackage's service container.

IServiceContainer.AddService(Type, Object)

Adds the given service to the VSPackage's service container.

IServiceContainer.AddService(Type, Object, Boolean)

Adds the given service to the VSPackage's service container.

IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

Adds the given service to the service container by means of the specified ServiceCreatorCallback.

IServiceContainer.AddService(Type, ServiceCreatorCallback)

Adds the given service to the VSPackage's 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);
abstract member System.ComponentModel.Design.IServiceContainer.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback -> unit
override this.System.ComponentModel.Design.IServiceContainer.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback -> unit
Sub AddService (serviceType As Type, callback As ServiceCreatorCallback) Implements IServiceContainer.AddService

Parameters

serviceType
Type

Type of service to add.

callback
ServiceCreatorCallback

ServiceCreatorCallback 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.

Implements

Applies to

IServiceContainer.AddService(Type, Object)

Adds the given service to the VSPackage's service container.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::Object ^ serviceInstance) = System::ComponentModel::Design::IServiceContainer::AddService;
 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Platform::Type ^ serviceType, Platform::Object ^ serviceInstance) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, object serviceInstance);
abstract member System.ComponentModel.Design.IServiceContainer.AddService : Type * obj -> unit
override this.System.ComponentModel.Design.IServiceContainer.AddService : Type * obj -> unit
Sub AddService (serviceType As Type, serviceInstance As Object) Implements IServiceContainer.AddService

Parameters

serviceType
Type

Type of service to add.

serviceInstance
Object

Service object.

Implements

Applies to

IServiceContainer.AddService(Type, Object, Boolean)

Adds the given service to the VSPackage's service container.

 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Type ^ serviceType, System::Object ^ serviceInstance, bool promote) = System::ComponentModel::Design::IServiceContainer::AddService;
 virtual void System.ComponentModel.Design.IServiceContainer.AddService(Platform::Type ^ serviceType, Platform::Object ^ serviceInstance, bool promote) = System::ComponentModel::Design::IServiceContainer::AddService;
void IServiceContainer.AddService (Type serviceType, object serviceInstance, bool promote);
abstract member System.ComponentModel.Design.IServiceContainer.AddService : Type * obj * bool -> unit
override this.System.ComponentModel.Design.IServiceContainer.AddService : Type * obj * bool -> unit
Sub AddService (serviceType As Type, serviceInstance As Object, promote As Boolean) Implements IServiceContainer.AddService

Parameters

serviceType
Type

Type of service to add.

serviceInstance
Object

Service object.

promote
Boolean

true if this service should be added to any parent service containers; otherwise, false.

Implements

Applies to

IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

Adds the given service to the service container by means of the specified ServiceCreatorCallback.

 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);
abstract member System.ComponentModel.Design.IServiceContainer.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback * bool -> unit
override this.System.ComponentModel.Design.IServiceContainer.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback * bool -> unit
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

ServiceCreatorCallback 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
Boolean

true if this service should be added to any parent service containers; otherwise, false.

Implements

Applies to