Udostępnij za pośrednictwem


Using the Text Manager to Monitor Global Settings

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

If you implement a core editor, you must monitor the changes that are made to global settings, because these changes may affect your instance of the editor. You can track the changes by listening to events raised by the text manager. For example, when you specify a global preference for the appearance or behavior of a component in the core editor, such as its document data object, the text manager stores this information and communicates it to all affected clients.

Text Manager Functions

The text manager raises events for a number of settings, including the following:

  • Whether a buffer is under source code control

  • How to register for file-change notifications

  • How to keep track of which views are associated with certain buffers

  • Text colorization preferences

  • Tab versus space preferences

    Preferences that are unique to a given language are not managed by the text manager. These settings must be managed by each language service.

    Event notification for the text manager is provided by the IVsTextManagerEvents interface. Implement this interface on your client object to handle events raised the text manager. You register for these events by using the IConnectionPointContainer interface on the text manager.

See Also

Inside the Core Editor
Editor Features