LanguageService.SetSite Method
Called to set or site the service provider for this language service.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣言
Public Sub SetSite ( _
site As Object _
)
public void SetSite(
Object site
)
Parameters
- site
Type: System.Object
[in] The object that is to be the parent service provider for this language service. This cannot be a null value!
Implements
IObjectWithSite.SetSite(Object)
Remarks
You can call this method after you instantiate the language service in your implementation of the LanguageService.Initialize method. Typically, the VSPackage is passed as the service provider. When LanguageService.GetService is called, it typically passes the request on the service provider given by LanguageService.SetSite. The object passed in must be derived from VSPackage and implement either the IServiceProvider or IOleServiceProvider interface.
The base method stores the service provider in an internal variable and calls GetProviderLocale on the service provider object (which is why the object must be derived from Microsoft.VisualStudio.Shell.Package).
.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.