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 _
)
public void AddService(
Type serviceType,
Object serviceInstance
)
public:
virtual void AddService(
Type^ serviceType,
Object^ serviceInstance
) sealed
abstract AddService :
serviceType:Type *
serviceInstance:Object -> unit
override AddService :
serviceType:Type *
serviceInstance:Object -> unit
public final function AddService(
serviceType : Type,
serviceInstance : Object
)
Parameters
serviceType
Type: System.TypeThe type of the service to add.
serviceInstance
Type: System.ObjectThe 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
- 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.