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.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Syntax
'Declaration
Protected Sub New ( _
mgr As CodeWindowManager _
)
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.
Tip
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.