次の方法で共有


ITextStructureNavigator.GetSpanOfEnclosing Method

Gets the span of the enclosing syntactic element of the specified snapshot span.

Namespace:  Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

Syntax

'宣言
Function GetSpanOfEnclosing ( _
    activeSpan As SnapshotSpan _
) As SnapshotSpan
SnapshotSpan GetSpanOfEnclosing(
    SnapshotSpan activeSpan
)
SnapshotSpan GetSpanOfEnclosing(
    SnapshotSpan activeSpan
)
abstract GetSpanOfEnclosing : 
        activeSpan:SnapshotSpan -> SnapshotSpan 
function GetSpanOfEnclosing(
    activeSpan : SnapshotSpan
) : SnapshotSpan

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.SnapshotSpan
A SnapshotSpan that represents the enclosing syntactic element. If the specified snapshot span covers multiple syntactic elements, then the method returns the least common ancestor of the elements.
If the snapshot span covers the root element (in other words, the whole document), then the method returns SnapshotSpan of the whole document.

.NET Framework Security

See Also

Reference

ITextStructureNavigator Interface

Microsoft.VisualStudio.Text.Operations Namespace