共用方式為


IProjectionSnapshot.GetSourceSpans 方法 (Int32, Int32)

取得來源範圍的指定位置開始的快照集 span 的唯讀集合。

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

語法

'宣告
Function GetSourceSpans ( _
    startSpanIndex As Integer, _
    count As Integer _
) As ReadOnlyCollection(Of SnapshotSpan)
ReadOnlyCollection<SnapshotSpan> GetSourceSpans(
    int startSpanIndex,
    int count
)
ReadOnlyCollection<SnapshotSpan>^ GetSourceSpans(
    int startSpanIndex, 
    int count
)
abstract GetSourceSpans : 
        startSpanIndex:int * 
        count:int -> ReadOnlyCollection<SnapshotSpan> 
function GetSourceSpans(
    startSpanIndex : int, 
    count : int
) : ReadOnlyCollection<SnapshotSpan>

參數

  • startSpanIndex
    類型:Int32

    要開始取得快照延伸的位置。 這是一個索引至來源 span 的集合,不能進入文字緩衝區中的字元。

  • count
    類型:Int32

    要取得的延伸數目。

傳回值

類型:ReadOnlyCollection<SnapshotSpan>
SnapshotSpan 物件的唯讀集合,這些物件是投影快照的來源。

例外狀況

例外狀況 條件
ArgumentOutOfRangeException

startSpanIndex小於零或大於 span 的數目。

-或-

count小於零或count加上startSpanIndex大於 span 的數目。

.NET Framework 安全性

請參閱

參考

IProjectionSnapshot 介面

GetSourceSpans 多載

Microsoft.VisualStudio.Text.Projection 命名空間