共用方式為


ITextSearchService.FindNext 方法

搜尋下一個出現的搜尋字串。

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

語法

'宣告
Function FindNext ( _
    startIndex As Integer, _
    wraparound As Boolean, _
    findData As FindData _
) As Nullable(Of SnapshotSpan)
Nullable<SnapshotSpan> FindNext(
    int startIndex,
    bool wraparound,
    FindData findData
)
Nullable<SnapshotSpan> FindNext(
    int startIndex, 
    bool wraparound, 
    FindData findData
)
abstract FindNext : 
        startIndex:int * 
        wraparound:bool * 
        findData:FindData -> Nullable<SnapshotSpan> 
function FindNext(
    startIndex : int, 
    wraparound : boolean, 
    findData : FindData
) : Nullable<SnapshotSpan>

參數

  • startIndex
    類型:Int32

    要開始搜尋的索引。

  • wraparound
    類型:Boolean

    決定搜尋是否在到達緩衝區的結尾時從緩衝區的開頭重新搜尋。

傳回值

類型:Nullable<SnapshotSpan>
SnapshotSpan 包含符合項目,如果找不到相符的項目,或nullnull 參考 (即 Visual Basic 中的 Nothing)如果找不到相符的項目。

例外狀況

例外狀況 條件
ArgumentNullException

findData 為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

ArgumentOutOfRangeException

startIndex小於零或大於資料的長度。

ArgumentException

UseRegularExpressions旗標已設定,並搜尋字串是無效的規則運算式。

.NET Framework 安全性

請參閱

參考

ITextSearchService 介面

Microsoft.VisualStudio.Text.Operations 命名空間