Condividi tramite


AsyncPackage.RemoveService Method

Definition

Overloads

RemoveService(Type)

Removes an async service registered with this package.

RemoveService(Type, Boolean)

Removes an async service registered with this package.

RemoveService(Type)

Removes an async service registered with this package.

public:
 virtual void RemoveService(Type ^ serviceType);
public:
 void RemoveService(Platform::Type ^ serviceType);
public void RemoveService (Type serviceType);
abstract member RemoveService : Type -> unit
override this.RemoveService : Type -> unit
Public Sub RemoveService (serviceType As Type)

Parameters

serviceType
Type

The service identity of the service that was registered in AddService(Type, AsyncServiceCreatorCallback) or AddService(Type, AsyncServiceCreatorCallback, Boolean)/>.

Implements

Exceptions

serviceType is null.

Remarks

If the underlying service implements IDisposable and is requested and activated during the lifetime of the package, Dispose() will be called automatically by RemoveService(Type).

This method is safe to access from any thread.

Applies to

RemoveService(Type, Boolean)

Removes an async service registered with this package.

public:
 virtual void RemoveService(Type ^ serviceType, bool ignored);
public:
 void RemoveService(Platform::Type ^ serviceType, bool ignored);
public void RemoveService (Type serviceType, bool ignored);
abstract member RemoveService : Type * bool -> unit
override this.RemoveService : Type * bool -> unit
Public Sub RemoveService (serviceType As Type, ignored As Boolean)

Parameters

serviceType
Type

The service identity of the service that was registered in AddService(Type, AsyncServiceCreatorCallback) or AddService(Type, AsyncServiceCreatorCallback, Boolean)/>.

ignored
Boolean

This parameter is ignored and exists only for symmetry with RemoveService(Type).

Implements

Exceptions

serviceType is null.

Remarks

If the underlying service implements IDisposable and is requested and activated during the lifetime of the package, Dispose() will be called automatically by RemoveService(Type, Boolean).

This method is safe to access from any thread.

Applies to