다음을 통해 공유


Package.IServiceContainer.AddService Method (Type, ServiceCreatorCallback, Boolean)

Adds the given service to the service container by means of the specified ServiceCreatorCallback.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)
  Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)

Syntax

‘선언
Private Sub AddService ( _
    serviceType As Type, _
    callback As ServiceCreatorCallback, _
    promote As Boolean _
) Implements IServiceContainer.AddService
‘사용 방법
Dim instance As Package
Dim serviceType As Type
Dim callback As ServiceCreatorCallback
Dim promote As Boolean

CType(instance, IServiceContainer).AddService(serviceType, _
    callback, promote)
void IServiceContainer.AddService(
    Type serviceType,
    ServiceCreatorCallback callback,
    bool promote
)
private:
virtual void AddService(
    Type^ serviceType, 
    ServiceCreatorCallback^ callback, 
    bool promote
) sealed = IServiceContainer::AddService
private abstract AddService : 
        serviceType:Type * 
        callback:ServiceCreatorCallback * 
        promote:bool -> unit 
private override AddService : 
        serviceType:Type * 
        callback:ServiceCreatorCallback * 
        promote:bool -> unit 
JScript does not support explicit interface implementations.

Parameters

  • serviceType
    Type: System.Type
    The type of service to add.
  • promote
    Type: System.Boolean
    true if this service should be added to any parent service containers; otherwise, false.

Implements

IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)

.NET Framework Security

See Also

Reference

Package Class

Package Members

AddService Overload

Microsoft.VisualStudio.Shell Namespace