Freigeben über


IVsTextManager2.GetUserPreferences2 Method

Definition

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

public:
 int GetUserPreferences2(cli::array <Microsoft::VisualStudio::TextManager::Interop::VIEWPREFERENCES2> ^ pViewPrefs, cli::array <Microsoft::VisualStudio::TextManager::Interop::FRAMEPREFERENCES2> ^ pFramePrefs, cli::array <Microsoft::VisualStudio::TextManager::Interop::LANGPREFERENCES2> ^ pLangPrefs, cli::array <Microsoft::VisualStudio::TextManager::Interop::FONTCOLORPREFERENCES2> ^ pColorPrefs);
int GetUserPreferences2(std::Array <Microsoft::VisualStudio::TextManager::Interop::VIEWPREFERENCES2> const & pViewPrefs, std::Array <Microsoft::VisualStudio::TextManager::Interop::FRAMEPREFERENCES2> const & pFramePrefs, std::Array <Microsoft::VisualStudio::TextManager::Interop::LANGPREFERENCES2> const & pLangPrefs, std::Array <Microsoft::VisualStudio::TextManager::Interop::FONTCOLORPREFERENCES2> const & pColorPrefs);
public int GetUserPreferences2 (Microsoft.VisualStudio.TextManager.Interop.VIEWPREFERENCES2[] pViewPrefs, Microsoft.VisualStudio.TextManager.Interop.FRAMEPREFERENCES2[] pFramePrefs, Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES2[] pLangPrefs, Microsoft.VisualStudio.TextManager.Interop.FONTCOLORPREFERENCES2[] pColorPrefs);
abstract member GetUserPreferences2 : Microsoft.VisualStudio.TextManager.Interop.VIEWPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.FRAMEPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.FONTCOLORPREFERENCES2[] -> int
Public Function GetUserPreferences2 (pViewPrefs As VIEWPREFERENCES2(), pFramePrefs As FRAMEPREFERENCES2(), pLangPrefs As LANGPREFERENCES2(), pColorPrefs As FONTCOLORPREFERENCES2()) As Integer

Parameters

pViewPrefs
VIEWPREFERENCES2[]

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

pFramePrefs
FRAMEPREFERENCES2[]

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

pLangPrefs
LANGPREFERENCES2[]

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

pColorPrefs
FONTCOLORPREFERENCES2[]

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

Returns

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

Applies to