Share via


ITextViewLineCollection.GetTextElementSpan Method

Gets the span whose text element span contains the given buffer position.

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

Syntax

'Declaration
Function GetTextElementSpan ( _
    bufferPosition As SnapshotPoint _
) As SnapshotSpan
SnapshotSpan GetTextElementSpan(
    SnapshotPoint bufferPosition
)
SnapshotSpan GetTextElementSpan(
    SnapshotPoint bufferPosition
)
abstract GetTextElementSpan : 
        bufferPosition:SnapshotPoint -> SnapshotSpan
function GetTextElementSpan(
    bufferPosition : SnapshotPoint
) : SnapshotSpan

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan
The SnapshotSpan that corresponds to the given text element index.

Exceptions

Exception Condition
ArgumentOutOfRangeException

bufferPosition does not correspond to a position on this line.

.NET Framework Security

See Also

Reference

ITextViewLineCollection Interface

Microsoft.VisualStudio.Text.Editor Namespace