次の方法で共有


IVsTextManagerEvents2.OnUserPreferencesChanged2 Method

Definition

Fired when the user's global preferences are changed.

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

Parameters

pViewPrefs
VIEWPREFERENCES2[]

[in] Pointer to the VIEWPREFERENCES structure. This structure provides the current settings for the view. If this is non-null, preferences that specifically affect text view behavior have changed.

pFramePrefs
FRAMEPREFERENCES2[]

[in] Pointer to the FRAMEPREFERENCES structure, which allows the frame to control whether the view shows horizontal or vertical scroll bars. If this is non-NULL, preferences that specifically affect code windows have changed.

pLangPrefs
LANGPREFERENCES2[]

[in] Pointer to the relevant language as specified by the szFileType and guidLang members of the LANGPREFERENCES structure. If this is non-null, preferences that affect a specific language's common settings have changed.

pColorPrefs
FONTCOLORPREFERENCES2[]

[in] Specifies color preferences. If non-null, the pguidColorService member of the FONTCOLORPREFERENCES structure indicates which colorable item provider is associated with the pColorTable member. If this is non-null, preferences that affect the colors or font used by a text view have changed.

Returns

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

Remarks

COM Signature

From textmgr2.idl:

void IVsTextManagerEvents2::OnUserPreferencesChanged2(  
   [in] const VIEWPREFERENCES2 * pViewPrefs,  
   [in] const FRAMEPREFERENCES2 * pFramePrefs,  
   [in] const LANGPREFERENCES2 * pLangPrefs,  
   [in] const FONTCOLORPREFERENCES2 * pColorPrefs  
);  

Use this method to modify your application in response to changes in user preferences. When the user changes global preferences, either due to changing settings from the Options command in the Tools menu or due to invoking a command, such as hitting the Insert key, this event is fired.

Applies to