IVsTextManagerEvents2.OnUserPreferencesChanged2 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在用户的全局首选项更改时激发。
public:
int OnUserPreferencesChanged2(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 OnUserPreferencesChanged2(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 OnUserPreferencesChanged2 (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 OnUserPreferencesChanged2 : Microsoft.VisualStudio.TextManager.Interop.VIEWPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.FRAMEPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.LANGPREFERENCES2[] * Microsoft.VisualStudio.TextManager.Interop.FONTCOLORPREFERENCES2[] -> int
Public Function OnUserPreferencesChanged2 (pViewPrefs As VIEWPREFERENCES2(), pFramePrefs As FRAMEPREFERENCES2(), pLangPrefs As LANGPREFERENCES2(), pColorPrefs As FONTCOLORPREFERENCES2()) As Integer
参数
- pViewPrefs
- VIEWPREFERENCES2[]
中指向结构的指针 VIEWPREFERENCES 。 此结构提供视图的当前设置。 如果此值为非 null,则会更改专门影响文本视图行为的首选项。
- pFramePrefs
- FRAMEPREFERENCES2[]
中指向结构的指针 FRAMEPREFERENCES ,该结构允许框架控制视图是显示水平滚动条还是垂直滚动条。 如果此值为非 NULL,则对代码窗口特别影响的首选项已更改。
- pLangPrefs
- LANGPREFERENCES2[]
中一个指针,指向结构的和成员指定的相关语言 szFileType guidLang LANGPREFERENCES 。 如果此值为非 null,则会更改影响特定语言的常见设置的首选项。
- pColorPrefs
- FONTCOLORPREFERENCES2[]
中指定颜色首选项。 如果非 null,则 pguidColorService 结构的成员 FONTCOLORPREFERENCES 指示哪个可着色项提供程序与成员关联 pColorTable 。 如果此值为非 null,则会更改影响文本视图所使用的颜色或字体的首选项。
返回
如果该方法成功,则它会返回 S_OK。 如果该方法失败,则会返回错误代码。
注解
COM 签名
从 textmgr2:
void IVsTextManagerEvents2::OnUserPreferencesChanged2(
[in] const VIEWPREFERENCES2 * pViewPrefs,
[in] const FRAMEPREFERENCES2 * pFramePrefs,
[in] const LANGPREFERENCES2 * pLangPrefs,
[in] const FONTCOLORPREFERENCES2 * pColorPrefs
);
使用此方法可修改应用程序以响应用户首选项的更改。 当用户更改全局首选项时,无论是通过 " 工具 " 菜单中的 "选项" 命令更改设置或者由于调用命令(如命中 Insert 键),都将激发此事件。