共用方式為


ITextViewLineCollection.GetTextElementSpan 方法

取得在文字項目範圍中包含指定緩衝區位置的範圍。

命名空間:  Microsoft.VisualStudio.Text.Editor
組件:  Microsoft.VisualStudio.Text.UI (在 Microsoft.VisualStudio.Text.UI.dll 中)

語法

'宣告
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

參數

傳回值

類型:Microsoft.VisualStudio.Text.SnapshotSpan
對應至指定文字項目索引的 SnapshotSpan

例外狀況

例外狀況 條件
ArgumentOutOfRangeException

bufferPosition沒有對應到在此線路上的位置。

.NET Framework 安全性

請參閱

參考

ITextViewLineCollection 介面

Microsoft.VisualStudio.Text.Editor 命名空間