ServiceProvider.CreateFromSetSite(IServiceProvider) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Create a new ServiceProvider for the given site.
public:
static Microsoft::VisualStudio::Shell::ServiceProvider ^ CreateFromSetSite(Microsoft::VisualStudio::OLE::Interop::IServiceProvider ^ sp);
public static Microsoft.VisualStudio.Shell.ServiceProvider CreateFromSetSite (Microsoft.VisualStudio.OLE.Interop.IServiceProvider sp);
static member CreateFromSetSite : Microsoft.VisualStudio.OLE.Interop.IServiceProvider -> Microsoft.VisualStudio.Shell.ServiceProvider
Public Shared Function CreateFromSetSite (sp As IServiceProvider) As ServiceProvider
Parameters
The OLE service provider
Returns
The service provider.
Remarks
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.
Note
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.