Partilhar via


DocumentProperties(CodeWindowManager) Constructor

Definition

Initializes a new instance of the DocumentProperties class.

protected:
 DocumentProperties(Microsoft::VisualStudio::Package::CodeWindowManager ^ mgr);
 DocumentProperties(Microsoft::VisualStudio::Package::CodeWindowManager const & mgr);
protected DocumentProperties (Microsoft.VisualStudio.Package.CodeWindowManager mgr);
new Microsoft.VisualStudio.Package.DocumentProperties : Microsoft.VisualStudio.Package.CodeWindowManager -> Microsoft.VisualStudio.Package.DocumentProperties
Protected Sub New (mgr As CodeWindowManager)

Parameters

mgr
CodeWindowManager

[in] The CodeWindowManager object that uses this DocumentProperties object.

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.  
        }  
    }  
}  

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.

Applies to