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
- activeSpan
Type: Microsoft.VisualStudio.Text.SnapshotSpan
The SnapshotSpan from which to get the enclosing syntactic element.
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.