Package.IServiceContainer.AddService Method (Type, Object)
This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.
Adds the given service to the VSPackage's service container.
Namespace: Microsoft.VisualStudio.Shell
Assembly: Microsoft.VisualStudio.Shell.11.0 (in Microsoft.VisualStudio.Shell.11.0.dll)
Syntax
'宣告
Private Sub AddService ( _
serviceType As Type, _
serviceInstance As Object _
) Implements IServiceContainer.AddService
void IServiceContainer.AddService(
Type serviceType,
Object serviceInstance
)
Parameters
- serviceType
Type: System.Type
Type of service to add.
- serviceInstance
Type: System.Object
Service object.
Implements
IServiceContainer.AddService(Type, Object)
.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.