GetTextViewLineContainingBufferPosition Method

ITextView.GetTextViewLineContainingBufferPosition Method (SnapshotPoint)


Gets the ITextViewLine that contains the specified text buffer position.

Namespace:   Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

ITextViewLine GetTextViewLineContainingBufferPosition(
	SnapshotPoint bufferPosition


Type: Microsoft.VisualStudio.Text.SnapshotPoint

The text buffer position used to search for a text line.

Return Value

Type: Microsoft.VisualStudio.Text.Formatting.ITextViewLine

The ITextViewLine that contains the specified buffer position.

Exception Condition

The view has not completed initialization.


bufferPosition is not a valid buffer position.

This method returns an ITextViewLine if it exists in the view. If the line does not exist in the cache of formatted lines, it will be formatted and added to the cache.

Return to top
© 2015 Microsoft