IWpfTextView.GetTextViewLineContainingBufferPosition(SnapshotPoint) Method

Definition

Gets the IWpfTextViewLine that contains the specified text buffer position.

public Microsoft.VisualStudio.Text.Formatting.IWpfTextViewLine GetTextViewLineContainingBufferPosition (Microsoft.VisualStudio.Text.SnapshotPoint bufferPosition);
Parameters
bufferPosition
SnapshotPoint

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

Returns

The IWpfTextViewLine that contains the specified buffer position.

Exceptions

The view has not completed initialization.

bufferPosition is not a valid buffer position.

Remarks

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.

Applies to