DocumentProperties Constructor
Initializes a new instance of the DocumentProperties class.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'宣告
Protected Sub New ( _
mgr As CodeWindowManager _
)
'用途
Dim mgr As CodeWindowManager
Dim instance As New DocumentProperties(mgr)
protected DocumentProperties(
CodeWindowManager mgr
)
protected:
DocumentProperties(
CodeWindowManager^ mgr
)
new :
mgr:CodeWindowManager -> DocumentProperties
protected function DocumentProperties(
mgr : CodeWindowManager
)
Parameters
- mgr
Type: Microsoft.VisualStudio.Package.CodeWindowManager
[in] The CodeWindowManager object that uses this DocumentProperties object.
Remarks
If you derive a class from the DocumentProperties class, you must call the base constructor from your constructor.
提示
A useful parameter to add to your constructor is your version of the LanguageService class. This allows you to access your version of the LanguageService class directly, without having to go through a Source object.
The base constructor caches the code window manager and then obtains an IVsTrackSelectionEx object from the SVsTrackSelectionEx service. This tracker is used to manage selections and property updates. The base constructor then sets the internal flag indicating that the properties on the DocumentProperties object are visible.
Examples
Here is a brief example of a DocumentProperties constructor that takes a particular language service class.
using Microsoft.VisualStudio.Package;
namespace MyLanguagePackage
{
class MyDocumentProperties : DocumentProperties
{
private MyLanguageService m_languageService;
MyDocumentProperties(CodeWindowManager mgr,
MyLanguageService langsrvc)
: base(mgr)
{
m_languageService = langsrvc.
}
}
}
.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.