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.

IWpfTextView.GetTextViewLineContainingBufferPosition Method

Gets the IWpfTextViewLine that contains the specified text buffer position.

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

IWpfTextViewLine GetTextViewLineContainingBufferPosition(
	SnapshotPoint bufferPosition
)

Parameters

bufferPosition
Type: Microsoft.VisualStudio.Text.SnapshotPoint

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

Return Value

Type: Microsoft.VisualStudio.Text.Formatting.IWpfTextViewLine
The IWpfTextViewLine that contains the specified buffer position.

ExceptionCondition
InvalidOperationException

The view has not completed initialization.

ArgumentOutOfRangeException

bufferPosition is not a valid buffer position.

This method returns an IWpfTextViewLine if it exists in the view. If the line does not exist in the cache of formatted lines, it is formatted and added to the cache. The returned IWpfTextViewLine could be invalidated by either a layout by the view or by subsequent calls to this method.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft