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 _
)
'Usage
Dim instance As ServiceProvider 
Dim serviceType As Type 
Dim serviceInstance As Object

instance.AddService(serviceType, serviceInstance)
public void AddService(
    Type serviceType,
    Object serviceInstance
)
public:
virtual void AddService(
    Type^ serviceType, 
    Object^ serviceInstance
) sealed
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

ServiceProvider Members

AddService Overload

Microsoft.VisualStudio.Data.Framework Namespace