IVsTextManager.GetUserPreferences 方法

返回用户首选项,例如选项使用、缩进大小和小部件边距显示一个视图、框架和语言服务的。

命名空间:  Microsoft.VisualStudio.TextManager.Interop
程序集:  Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

语法

声明
Function GetUserPreferences ( _
    <OutAttribute> pViewPrefs As VIEWPREFERENCES(), _
    <OutAttribute> pFramePrefs As FRAMEPREFERENCES(), _
    <OutAttribute> pLangPrefs As LANGPREFERENCES(), _
    <OutAttribute> pColorPrefs As FONTCOLORPREFERENCES() _
) As Integer
int GetUserPreferences(
    VIEWPREFERENCES[] pViewPrefs,
    FRAMEPREFERENCES[] pFramePrefs,
    LANGPREFERENCES[] pLangPrefs,
    FONTCOLORPREFERENCES[] pColorPrefs
)
int GetUserPreferences(
    [OutAttribute] array<VIEWPREFERENCES>^ pViewPrefs, 
    [OutAttribute] array<FRAMEPREFERENCES>^ pFramePrefs, 
    [InAttribute] [OutAttribute] array<LANGPREFERENCES>^ pLangPrefs, 
    [InAttribute] [OutAttribute] array<FONTCOLORPREFERENCES>^ pColorPrefs
)
abstract GetUserPreferences : 
        pViewPrefs:VIEWPREFERENCES[] byref * 
        pFramePrefs:FRAMEPREFERENCES[] byref * 
        pLangPrefs:LANGPREFERENCES[] byref * 
        pColorPrefs:FONTCOLORPREFERENCES[] byref -> int
function GetUserPreferences(
    pViewPrefs : VIEWPREFERENCES[], 
    pFramePrefs : FRAMEPREFERENCES[], 
    pLangPrefs : LANGPREFERENCES[], 
    pColorPrefs : FONTCOLORPREFERENCES[]
) : int

参数

返回值

类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 textmgr.idl:

HRESULT IVsTextManager::GetUserPreferences(
   [out] VIEWPREFERENCES * pViewPrefs,
   [out] FRAMEPREFERENCES * pFramePrefs,
   [in, out] LANGPREFERENCES * pLangPrefs,
   [in, out] FONTCOLORPREFERENCES * pColorPrefs
);

使用此方法来确定视图、框架、语言、字体和颜色的喜好问题。 在 GUID 的通过相应的项和方法的返回这些首选项加载的结构。 在每个结构的 GUID 不要求您通过,如果您只需要一个项目的首选项 (例如,您希望视图首选项)。 将在不要加载的结构的 nullnull 引用(在 Visual Basic 中为 Nothing) 。

.NET Framework 安全性

请参阅

参考

IVsTextManager 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间