ServiceProvider::CreateFromSetSite Method (IServiceProvider^)

 

Create a new ServiceProvider for the given site.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)

public:
static ServiceProvider^ CreateFromSetSite(
	IServiceProvider^ sp
)

Parameters

sp
Type: Microsoft.VisualStudio.OLE.Interop::IServiceProvider^

The OLE service provider

Return Value

Type: Microsoft.VisualStudio.Shell::ServiceProvider^

The service provider.

This method should be called from an object that implements SetSite() (for example, IObjectWithSite or IVsPackage). It sets the global service provider if it hasn't already been set.

This method is typically called from the SetSite() method of a VSPackage.

System_CAPS_noteNote

By calling this method, the caller declares that it knows the global OLE service provider for the calling thread and that the service provider instance returned may be used by other, unrelated components, accessed via the GlobalProvider static property.

Return to top
Show: