Udostępnij za pośrednictwem


ServiceProvider.AddService Method

Definition

Overloads

AddService(Type, ServiceCreatorCallback)

Adds the specified service to the internal collection of services.

AddService(Type, Object)

Adds the specified service to the internal collection of services.

AddService(Type, ServiceCreatorCallback, Boolean)

Adds the specified service to the internal collection of services or to the parent service container.

AddService(Type, Object, Boolean)

Adds the specified service to the collection of service objects or to the parent service container.

AddService(Type, ServiceCreatorCallback)

Adds the specified service to the internal collection of services.

public:
 virtual void AddService(Type ^ serviceType, System::ComponentModel::Design::ServiceCreatorCallback ^ callback);
public void AddService (Type serviceType, System.ComponentModel.Design.ServiceCreatorCallback callback);
abstract member AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback -> unit
override this.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback -> unit
Public Sub AddService (serviceType As Type, callback As ServiceCreatorCallback)

Parameters

serviceType
Type

The type of the service to add.

callback
ServiceCreatorCallback

A callback object that is used to create the service.

Implements

Applies to

AddService(Type, Object)

Adds the specified service to the internal collection of services.

public:
 virtual void AddService(Type ^ serviceType, System::Object ^ serviceInstance);
public void AddService (Type serviceType, object serviceInstance);
abstract member AddService : Type * obj -> unit
override this.AddService : Type * obj -> unit
Public Sub AddService (serviceType As Type, serviceInstance As Object)

Parameters

serviceType
Type

The type of the service to add.

serviceInstance
Object

The service object instance to add.

Implements

Applies to

AddService(Type, ServiceCreatorCallback, Boolean)

Adds the specified service to the internal collection of services or to the parent service container.

public:
 virtual void AddService(Type ^ serviceType, System::ComponentModel::Design::ServiceCreatorCallback ^ callback, bool promote);
public virtual void AddService (Type serviceType, System.ComponentModel.Design.ServiceCreatorCallback callback, bool promote);
abstract member AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback * bool -> unit
override this.AddService : Type * System.ComponentModel.Design.ServiceCreatorCallback * bool -> unit
Public Overridable Sub AddService (serviceType As Type, callback As ServiceCreatorCallback, promote As Boolean)

Parameters

serviceType
Type

The type of the service to add.

callback
ServiceCreatorCallback

A callback object that is used to create the service.

promote
Boolean

A Boolean value indicating whether to add the service to the parent container.

Implements

Applies to

AddService(Type, Object, Boolean)

Adds the specified service to the collection of service objects or to the parent service container.

public:
 virtual void AddService(Type ^ serviceType, System::Object ^ serviceInstance, bool promote);
public virtual void AddService (Type serviceType, object serviceInstance, bool promote);
abstract member AddService : Type * obj * bool -> unit
override this.AddService : Type * obj * bool -> unit
Public Overridable Sub AddService (serviceType As Type, serviceInstance As Object, promote As Boolean)

Parameters

serviceType
Type

The type of the service to add.

serviceInstance
Object

The service object to add.

promote
Boolean

A Boolean value indicating whether to add the service to the parent container.

Implements

Applies to