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
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'Declaration
Private Sub AddService ( _
serviceType As Type, _
callback As ServiceCreatorCallback, _
promote As Boolean _
) Implements IServiceContainer.AddService
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.TypeThe type of service to add.
callback
Type: System.ComponentModel.Design.ServiceCreatorCallbackServiceCreatorCallback that can create the service. This allows a service to be declared as available, but delays creation of the object until the service is requested.
promote
Type: System.Booleantrue if this service should be added to any parent service containers; otherwise, false.
Implements
IServiceContainer.AddService(Type, ServiceCreatorCallback, Boolean)
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.