共用方式為


ITextView.GetTextElementSpan Method

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)

Syntax

'宣告
Function GetTextElementSpan ( _
    point As SnapshotPoint _
) As SnapshotSpan
SnapshotSpan GetTextElementSpan(
    SnapshotPoint point
)
SnapshotSpan GetTextElementSpan(
    SnapshotPoint point
)
abstract GetTextElementSpan : 
        point:SnapshotPoint -> SnapshotSpan 
function GetTextElementSpan(
    point : SnapshotPoint
) : SnapshotSpan

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan
A SnapshotSpan containing the bounds of the text element.

Exceptions

Exception Condition
ArgumentException

point is from the wrong ITextBuffer.

Remarks

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.

.NET Framework Security

See Also

Reference

ITextView Interface

Microsoft.VisualStudio.Text.Editor Namespace