IVsTextManager2.GetUserPreferences2 Method

Returns the user preferences, such as tab usage, indent size and widget margin presence for the view, frame, and language service.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop.8.0 (in Microsoft.VisualStudio.TextManager.Interop.8.0.dll)

Syntax

'宣言
Function GetUserPreferences2 ( _
    <OutAttribute> pViewPrefs As VIEWPREFERENCES2(), _
    <OutAttribute> pFramePrefs As FRAMEPREFERENCES2(), _
    <OutAttribute> pLangPrefs As LANGPREFERENCES2(), _
    <OutAttribute> pColorPrefs As FONTCOLORPREFERENCES2() _
) As Integer
'使用
Dim instance As IVsTextManager2
Dim pViewPrefs As VIEWPREFERENCES2()
Dim pFramePrefs As FRAMEPREFERENCES2()
Dim pLangPrefs As LANGPREFERENCES2()
Dim pColorPrefs As FONTCOLORPREFERENCES2()
Dim returnValue As Integer

returnValue = instance.GetUserPreferences2(pViewPrefs, _
    pFramePrefs, pLangPrefs, pColorPrefs)
int GetUserPreferences2(
    VIEWPREFERENCES2[] pViewPrefs,
    FRAMEPREFERENCES2[] pFramePrefs,
    LANGPREFERENCES2[] pLangPrefs,
    FONTCOLORPREFERENCES2[] pColorPrefs
)
int GetUserPreferences2(
    [OutAttribute] array<VIEWPREFERENCES2>^ pViewPrefs, 
    [OutAttribute] array<FRAMEPREFERENCES2>^ pFramePrefs, 
    [InAttribute] [OutAttribute] array<LANGPREFERENCES2>^ pLangPrefs, 
    [InAttribute] [OutAttribute] array<FONTCOLORPREFERENCES2>^ pColorPrefs
)
function GetUserPreferences2(
    pViewPrefs : VIEWPREFERENCES2[], 
    pFramePrefs : FRAMEPREFERENCES2[], 
    pLangPrefs : LANGPREFERENCES2[], 
    pColorPrefs : FONTCOLORPREFERENCES2[]
) : int

Parameters

  • pViewPrefs
    Type: []

    [out] Pointer to the view preferences. For more information about pViewPrefs, see VIEWPREFERENCES2.

  • pFramePrefs
    Type: []

    [out] Pointer to the frame preferences. For more information about pFramePrefs, see FRAMEPREFERENCES2.

  • pLangPrefs
    Type: []

    [in, out] Pointer to the language preferences. For more information about pLangPrefs, see LANGPREFERENCES2.

  • pColorPrefs
    Type: []

    [in, out] Pointer to the font color preferences.

Return Value

Type: System.Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

[in] Pointer to the IVsTextBuffer interface.

HRESULT IVsTextManager2::GetUserPreferences2(
   [out] VIEWPREFERENCES2 * pViewPrefs,
   [out] FRAMEPREFERENCES2 * pFramePrefs,
   [in, out] LANGPREFERENCES2 * pLangPrefs,
   [in, out] FONTCOLORPREFERENCES2 * pColorPrefs
); 

Use this method to determine view, frame, language, font, and color preferences. Pass in the GUID for the appropriate item and the method returns the filled structure for those preferences. You are not required to pass in a GUID for each structure if you only want preferences for one item (for example, you only want view preferences). Pass in a null reference (Nothing in Visual Basic) for the structures that you do not want to fill.

For the LANGPREFERENCES member, specify the language in question by setting pLangPrefs->guidLang to the language SID.

Permissions

See Also

Reference

IVsTextManager2 Interface

IVsTextManager2 Members

Microsoft.VisualStudio.TextManager.Interop Namespace