Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IVsTextBuffer Interface

Acts as the base interface for the VsTextBuffer object and provides general information about the text buffer's properties. Also see IVsTextBufferEx, which adds GetTrackChanges and SetTrackChangesSuppression methods.

Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in microsoft.visualstudio.textmanager.interop.dll)

[GuidAttribute("C08E5275-0D26-4DE9-8892-994024C23750")] 
[InterfaceTypeAttribute(1)] 
public interface IVsTextBuffer
/** @attribute GuidAttribute("C08E5275-0D26-4DE9-8892-994024C23750") */ 
/** @attribute InterfaceTypeAttribute(1) */ 
public interface IVsTextBuffer
GuidAttribute("C08E5275-0D26-4DE9-8892-994024C23750") 
InterfaceTypeAttribute(1) 
public interface IVsTextBuffer

The IVsTextBuffer interface provides basic services and is used by many clients. The IVsTextBuffer interface also provides general information about the text buffer properties. For example, it determines whether the buffer is read-only, if the buffer has been modified, and which language service is associated with the buffer. IVsTextBuffer fires the IVsTextBufferEvents interface when there is a change in the language service. At the same time, the system notifies you of the switch to a different language service.

For the current buffer implementation, it is faster to read data from the interface IVsTextLines than to use IVsTextBuffer.

NoteNote

The position values used in this interface are a zero-based character index into a Unicode stream. It is always the caller's responsibility to ensure that you do not request positions past the end of the buffer. Call the method GetSize to determine the character index position.

See illustrations of the implementation and/or calling of this interface in the samples Figures Edit Sample and Solution Extender Sample.

Notes to Callers This interface is implemented as part of the VsTextBuffer object. As a VSPackage implementer, you would call QueryInterface to get a pointer to the IVsTextBuffer interface when using the core editor objects.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2014 Microsoft