Share via


ActionContext.AddService Method (Type, ServiceCreatorCallback)

Adds the specified service to the service container. This class cannot be inherited.

Namespace:  Microsoft.SqlServer.Management
Assembly:  Microsoft.SqlServer.Management.SDK.SqlStudio (in Microsoft.SqlServer.Management.SDK.SqlStudio.dll)

Syntax

'Declaration
Public Sub AddService ( _
    serviceType As Type, _
    callback As ServiceCreatorCallback _
)
'Usage
Dim instance As ActionContext
Dim serviceType As Type
Dim callback As ServiceCreatorCallback

instance.AddService(serviceType, callback)
public void AddService(
    Type serviceType,
    ServiceCreatorCallback callback
)
public:
virtual void AddService(
    Type^ serviceType, 
    ServiceCreatorCallback^ callback
) sealed
abstract AddService : 
        serviceType:Type * 
        callback:ServiceCreatorCallback -> unit 
override AddService : 
        serviceType:Type * 
        callback:ServiceCreatorCallback -> unit 
public final function AddService(
    serviceType : Type, 
    callback : ServiceCreatorCallback
)

Parameters

  • serviceType
    Type: System.Type
    The type of service to add.

Implements

IServiceContainer.AddService(Type, ServiceCreatorCallback)