IVsTextManager2.GetUserPreferences2 方法

定义

返回视图、框架和语言服务的用户首选项,如选项卡使用情况、缩进大小和小组件边距状态。

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

参数

pViewPrefs
VIEWPREFERENCES2[]

弄指向视图首选项的指针。 有关 pViewPrefs的更多信息,请参见VIEWPREFERENCES2

pFramePrefs
FRAMEPREFERENCES2[]

弄指向帧首选项的指针。 有关 pFramePrefs的更多信息,请参见FRAMEPREFERENCES2

pLangPrefs
LANGPREFERENCES2[]

[in,out]指向语言首选项的指针。 有关 pLangPrefs的更多信息,请参见LANGPREFERENCES2

pColorPrefs
FONTCOLORPREFERENCES2[]

[in,out]指向字体颜色首选项的指针。

返回

Int32

如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。

注解

中指向接口的指针 IVsTextBuffer

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

使用此方法可以确定视图、框架、语言、字体和颜色首选项。 传入相应项的 GUID,方法返回这些首选项的填充结构。 如果只需要一个项的首选项,则无需为每个结构传入 GUID (例如,只需) 的查看首选项。 传入 null 不需要填充的结构。

对于 LANGPREFERENCES 成员,通过将 pLangPrefs >guidLang 设置为 language SID 来指定相关语言。

适用于