Compartir a través de


ServiceProvider.AddService Method (Type, Object)

Adds the specified service to the internal collection of services.

Namespace:  Microsoft.VisualStudio.Data.Framework
Assembly:  Microsoft.VisualStudio.Data.Framework (in Microsoft.VisualStudio.Data.Framework.dll)

Syntax

'Declaration
Public Sub AddService ( _
    serviceType As Type, _
    serviceInstance As Object _
)
public void AddService(
    Type serviceType,
    Object serviceInstance
)
public:
virtual void AddService(
    Type^ serviceType, 
    Object^ serviceInstance
) sealed
abstract AddService : 
        serviceType:Type * 
        serviceInstance:Object -> unit  
override AddService : 
        serviceType:Type * 
        serviceInstance:Object -> unit
public final function AddService(
    serviceType : Type, 
    serviceInstance : Object
)

Parameters

  • serviceType
    Type: System.Type

    The type of the service to add.

  • serviceInstance
    Type: System.Object

    The service object instance to add.

Implements

IServiceContainer.AddService(Type, Object)

Remarks

This method calls AddService with the Boolean parameter set to false.

.NET Framework Security

See Also

Reference

ServiceProvider Class

AddService Overload

Microsoft.VisualStudio.Data.Framework Namespace