ITextStructureNavigator.GetSpanOfPreviousSibling(SnapshotSpan) 方法

定义

获取指定快照范围的上一个同级语法元素的跨度。 如果指定跨度的长度为零,则行为与的行为相同 GetSpanOfEnclosing(SnapshotSpan)

public:
 Microsoft::VisualStudio::Text::SnapshotSpan GetSpanOfPreviousSibling(Microsoft::VisualStudio::Text::SnapshotSpan activeSpan);
Microsoft::VisualStudio::Text::SnapshotSpan GetSpanOfPreviousSibling(Microsoft::VisualStudio::Text::SnapshotSpan activeSpan);
public Microsoft.VisualStudio.Text.SnapshotSpan GetSpanOfPreviousSibling (Microsoft.VisualStudio.Text.SnapshotSpan activeSpan);
abstract member GetSpanOfPreviousSibling : Microsoft.VisualStudio.Text.SnapshotSpan -> Microsoft.VisualStudio.Text.SnapshotSpan
Public Function GetSpanOfPreviousSibling (activeSpan As SnapshotSpan) As SnapshotSpan

参数

activeSpan
SnapshotSpan

SnapshotSpan要从中获取上一个同级语法元素的范围的。

返回

SnapshotSpan

SnapshotSpan表示上一个同级语法元素的。 如果指定的快照范围涵盖多个句法元素,则此方法返回上一个元素的范围。 如果指定的快照范围涵盖没有同级元素的句法元素,则该行为与的行为相同 GetSpanOfEnclosing(SnapshotSpan)

注解

如果指定跨度的长度为零,则行为与的行为相同 GetSpanOfEnclosing

如果指定的快照范围涵盖多个句法元素,则此方法返回上一个元素的范围。

如果指定的快照范围涵盖没有同级元素的句法元素,则该行为与的行为相同 GetSpanOfEnclosing

适用于