Επεξεργασία

Κοινή χρήση μέσω


ServiceContainer.RemoveService Method

Definition

Removes the specified service type from the service container.

Overloads

RemoveService(Type)

Removes the specified service type from the service container.

RemoveService(Type, Boolean)

Removes the specified service type from the service container.

RemoveService(Type)

Source:
ServiceContainer.cs
Source:
ServiceContainer.cs
Source:
ServiceContainer.cs

Removes the specified service type from the service container.

public:
 virtual void RemoveService(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 type of service to remove.

Implements

Exceptions

serviceType is null.

Examples

The following example illustrates how to remove a service from a ServiceContainer.

m_MyServiceContainer->RemoveService( Control::typeid );
m_MyServiceContainer.RemoveService(typeof(Control));
m_MyServiceContainer.RemoveService(GetType(Control))

See also

Applies to

RemoveService(Type, Boolean)

Source:
ServiceContainer.cs
Source:
ServiceContainer.cs
Source:
ServiceContainer.cs

Removes the specified service type from the service container.

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

Parameters

serviceType
Type

The type of service to remove.

promote
Boolean

true if this service should be removed from any parent service containers; otherwise, false.

Implements

Exceptions

serviceType is null.

See also

Applies to