Export (0) Print
Expand All

IVsTextStream Interface

Provides reading and writing capabilities using one-dimensional coordinates.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

[InterfaceTypeAttribute()]
[GuidAttribute("D3AF020B-A862-4D22-B373-20F1B30B7D9E")]
public interface IVsTextStream : IVsTextBuffer

The IVsTextStream type exposes the following members.

  NameDescription
Public methodAdviseTextStreamEventsNot implemented.
Public methodCanReplaceStreamTests whether a given editing operation can succeed (for example, copy or cut).
Public methodCreateEditPointCreates an EditPoint object at the given location in the text buffer.
Public methodCreateStreamMarkerCreates a stream marker of a given type over the specified region.
Public methodCreateTextPointCreates a TextPoint object at the given location in the text buffer.
Public methodEnumMarkersEnumerates s specific set of text stream markers, based on the criteria specified.
Public methodFindMarkerByPositionLocates a marker of a given type based on a position in the text stream.
Public methodGetLanguageServiceIDReturns the unique identifier of the language that is providing colorization and other attribute data to this buffer.
Public methodGetLastLineIndexReturns the last line in the text buffer.
Public methodGetLengthOfLineReturns the length of a line in the buffer.
Public methodGetLineCountReturns the number of lines in the buffer.
Public methodGetLineIndexOfPositionReturns the line and column numbers in the text buffer, given a position number.
Public methodGetPositionOfLineReturns the position number of a line.
Public methodGetPositionOfLineIndexReturns the position number in the text buffer, given a line and column number.
Public methodGetSizeReturns the size in characters of the buffer.
Public methodGetStateFlagsReturns the state flags of the text buffer.
Public methodGetStreamProvides direct, stream-oriented access to the text buffer.
Public methodGetUndoManagerReturns the undo manager for this buffer.
Public methodInitializeContentInitializes the content of the text buffer.
Public methodLockBufferLocks the text buffer for the purpose of access control.
Public methodLockBufferExExtension of the LockBuffer method.
Public methodReloadReloads the text buffer.
Public methodReloadStreamReplaces text without deleting markers.
Public methodReplaceStreamHandles editing, such as line breaking, line joining, and so on.
Public methodReplaceStreamExHandles editing, such as line breaking, line joining, and so on.
Public methodReserved1Reserved in the Vtable for future use.
Public methodReserved10Reserved in the Vtable for future use.
Public methodReserved2Reserved in the Vtable for future use.
Public methodReserved3Reserved in the Vtable for future use.
Public methodReserved4Reserved in the Vtable for future use.
Public methodReserved5Reserved in the Vtable for future use.
Public methodReserved6Reserved in the Vtable for future use.
Public methodReserved7Reserved in the Vtable for future use.
Public methodReserved8Reserved in the Vtable for future use.
Public methodReserved9Reserved in the Vtable for future use.
Public methodSetLanguageServiceIDSets the unique identifier of the language that is providing colorization and other attribute data to the buffer.
Public methodSetStateFlagsSets the state flags of the text buffer.
Public methodUnadviseTextStreamEventsNot implemented.
Public methodUnlockBufferUnlocks a buffer locked with the method LockBuffer.
Public methodUnlockBufferExExtension of the UnlockBuffer method.
Top

The IVsTextStream interface provides access to the contents of a text buffer in as a linear stream of text using one-dimensional coordinates. Text is referred to as lines separated by end-of-line (EOL) indicators. Coordinates are of type Long. Using this interface imposes overhead resulting from the need to transform coordinates to and from a one-dimensional system. Do not use IVsTextStream with a buffer that contains Visual Basic text or the performance overhead can be severe. In general, use of stream coordinates is discouraged.

IVsTextStream fires the IVsTextStreamEvents interface, which is identical to IVsTextLinesEvents except for the coordinate system that describes the text. When IVsTextStream fires an event called IVsTextStreamEvents, the system informs you that the text or attributes in the buffer have changed.

Starting in Visual Studio 2010, you should access the text buffer on the UI thread, not on background threads. The text buffer no longer gets locked when you call LockBuffer or LockBufferEx. Similarly, the UnlockBuffer and UnlockBufferEx methods no longer have any effect.

Notes to Implementers

Implemented by text buffers in the environment.

Notes to Callers

Called by clients that want to access the text buffer using one-dimensional coordinates. You can use the text buffer object to read or change text.

Show:
© 2015 Microsoft