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
參數
bufferPosition
類型:Microsoft.VisualStudio.Text.SnapshotPoint緩衝區位置。
傳回值
類型:Microsoft.VisualStudio.Text.SnapshotSpan
對應至指定文字項目索引的 SnapshotSpan。
例外狀況
例外狀況 | 條件 |
---|---|
ArgumentOutOfRangeException | bufferPosition沒有對應到在此線路上的位置。 |
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。