Partager via


ServiceProvider Constructor (IServiceProvider, Boolean)

Initializes a new instance of the ServiceProvider class with an existing IServiceProvider object and optionally passes all requests to the underlying service provider.

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

Syntax

'Déclaration
Public Sub New ( _
    sp As IServiceProvider, _
    defaultServices As Boolean _
)
'Utilisation
Dim sp As IServiceProvider
Dim defaultServices As Boolean

Dim instance As New ServiceProvider(sp, defaultServices)
public ServiceProvider(
    IServiceProvider sp,
    bool defaultServices
)
public:
ServiceProvider(
    IServiceProvider^ sp, 
    bool defaultServices
)
new : 
        sp:IServiceProvider * 
        defaultServices:bool -> ServiceProvider
public function ServiceProvider(
    sp : IServiceProvider, 
    defaultServices : boolean
)

Parameters

Remarks

Initializes a new ServiceProvider and uses the provided IServiceProvider interface to resolve services. If defaultServices is equal to true (the default) a query for the IServiceProvider interface will return the underlying COM service provider and a query for the IObjectWithSite interface will return this object. If defaultServices is equal to false these two services will not be provided and the service provider will be "transparent" and pass all requests for services to the given service provider.

.NET Framework Security

See Also

Reference

ServiceProvider Class

ServiceProvider Members

ServiceProvider Overload

Microsoft.VisualStudio.Shell Namespace