GetTextElementSpan Method
Collapse the table of content
Expand the table of content

ITextView.GetTextElementSpan Method (SnapshotPoint)

 

Gets the SnapshotSpan of text that constitutes a text element (a single visual representation) at the given SnapshotPoint.

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

SnapshotSpan GetTextElementSpan(
	SnapshotPoint point
)

Parameters

point
Type: Microsoft.VisualStudio.Text.SnapshotPoint

The SnapshotPoint in the text snapshot at which to get the text element.

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan

A SnapshotSpan containing the bounds of the text element.

Exception Condition
ArgumentException

point is from the wrong ITextBuffer.

A text element may be a UTF-16 surrogate pair, consisting of a high surrogate character and a low surrogate character. If a point in the text buffer lies between a high surrogate character and a low surrogate character, the text element span will start at the high surrogate character and end at the low surrogate character.

Return to top
Show:
© 2016 Microsoft