IVsTextManager Interface
Provides general services for anyone wanting information about the active text views.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
Syntax
'宣告
<InterfaceTypeAttribute()> _
<GuidAttribute("909F83E3-B3FC-4BBF-8820-64378744B39B")> _
Public Interface IVsTextManager
[InterfaceTypeAttribute()]
[GuidAttribute("909F83E3-B3FC-4BBF-8820-64378744B39B")]
public interface IVsTextManager
[InterfaceTypeAttribute()]
[GuidAttribute(L"909F83E3-B3FC-4BBF-8820-64378744B39B")]
public interface class IVsTextManager
[<InterfaceTypeAttribute()>]
[<GuidAttribute("909F83E3-B3FC-4BBF-8820-64378744B39B")>]
type IVsTextManager = interface end
public interface IVsTextManager
The IVsTextManager type exposes the following members.
Methods
Name | Description | |
---|---|---|
AdjustFileChangeIgnoreCount | Increases or decreases the ignore count for file changes. | |
AttemptToCheckOutBufferFromScc | Method information not provided. | |
AttemptToCheckOutBufferFromScc2 | Attempts to check out a file from source code control. | |
CreateSelectionAction | Method information is not provided. Do not use this method. | |
EnumBuffers | Enumerates text buffers. Not yet implemented. | |
EnumIndependentViews | Enumerates the independent views. | |
EnumLanguageServices | Enumerates the registered language service IDs. | |
EnumViews | Enumerates views that are provided with the core editor and are associated with a particular text buffer. | |
GetActiveView | Returns the active or previously active view. | |
GetBufferSccStatus | Method information not provided. Do not use this method. | |
GetBufferSccStatus2 | Returns information on whether a buffer is under source code control and, if so, whether the file is checked in. | |
GetMarkerTypeCount | Returns the number of registered marker types within all buffers associated with the core text editor. | |
GetMarkerTypeInterface | Maps a numeric marker type ID to an interface that can be used to probe for specific information. | |
GetPerLanguagePreferences | Method information is not provided. | |
GetRegisteredMarkerTypeID | Returns a registered marker type. | |
GetShortcutManager | Returns the shortcut manager. | |
GetUserPreferences | Returns the user preferences, such as tab usage, indent size and widget margin presence for the view, frame, and language service. | |
IgnoreNextFileChange | Notifies that the next file change is to be ignored. | |
MapFilenameToLanguageSID | Given a file name, determines the registered language service, if one exists, that understands it. | |
NavigateToLineAndColumn | Finds or creates an appropriate view on the specified buffer and places the selection at the specified location. | |
NavigateToPosition | Finds or creates an appropriate view on the specified buffer and puts the selection on the specified linear position. | |
RegisterBuffer | Registers a text buffer with the text manager. | |
RegisterIndependentView | Registers a view from a source other than the core editor. | |
RegisterView | Method information is not provided. | |
SetFileChangeAdvise | Method information is not provided. | |
SetPerLanguagePreferences | Method information is not provided. | |
SetUserPreferences | Sets user preferences. | |
SuspendFileChangeAdvise | Suspends file change notifications for a given file. | |
UnregisterBuffer | Unregisters a buffer. | |
UnregisterIndependentView | Unregisters an externally-created view. | |
UnregisterView | Method information is not provided. |
Top
Remarks
There is one text manager in the environment. The text manager manages all of the text buffers that are active at any given point, all of the user settings for the different languages, and any other global preferences related to the core text editor. When the user specifies preferences for the appearance and/or behavior of components in the text editor, the text manager stores this information and communicates it to all relevant clients. Examples include color preferences, tab versus space preferences, and so on. Preferences that are unique to a given language (that is, that apply to one language but to no other) are not stored here. These settings are managed by the individual language services.
The text manager provides a central location for components to discover common information, such as whether a buffer is under source-code control, registering for file-change notifications, keeping track of which views are associated with which buffers, and so on.
See illustrations of the implementation and/or calling of this interface in the sample Figures Edit.
注意
For historical reasons, VSPackages using the Managed Package Framework, use VsTextManagerClass (the class implementing IVsTextManager) with System.typeof, instead of IVsTextManager, to obtain the serviceType argument for GetService. The return value of GetService must then be cast to IVsTextManager. For more information see GetService.
An IVsTextManager interface can be obtained with:
IVsTextManager mytext_mgr = myPackage.GetService(System.typeof(VsTextManagerClass)) as IVsTextManager;
Notes to Implementers
Implemented by the environment.
Notes to Callers
Called by any component that needs to learn about the current view or other information related to the global preferences. The methods of IVsTextManager are most likely required by tools that interact with the Visual Studio core editor.