IncrementalSearch.SearchWithLastPattern メソッド
パターンを変更せずに現在の ISearch を繰り返します。
名前空間: EnvDTE80
アセンブリ: EnvDTE80 (EnvDTE80.dll 内)
構文
'宣言
Function SearchWithLastPattern As vsIncrementalSearchResult
vsIncrementalSearchResult SearchWithLastPattern()
vsIncrementalSearchResult SearchWithLastPattern()
abstract SearchWithLastPattern : unit -> vsIncrementalSearchResult
function SearchWithLastPattern() : vsIncrementalSearchResult
戻り値
型 : EnvDTE80.vsIncrementalSearchResult
vsIncrementalSearchResult 列挙体。
解説
SearchWithLastPattern は、最後に実行した検索で新しい検索を開始する場合に使用します。パターンが空の場合、またはその文字列に一致する部分がそれ以上ない場合、このメソッドは失敗します。
SearchWithLastPattern は検索パターンを変更しません。
例
Sub testIS2()
' Before running, open a document in Visual Studio.
' Set variables for text pane.
Dim tp As EnvDTE80.TextPane2
tp = CType(DTE.ActiveDocument.ActiveWindow.Object.ActivePane, _
TextPane2)
' Start an incremental search backward from
' the current insertion point in the document.
tp.IncrementalSearch.StartBackward()
' Add the character "a" to the search pattern.
tp.IncrementalSearch.AppendCharAndSearch(Asc("a"))
' Display the parent name for IncrementalSearch object.
MsgBox("IncrementalSearch parent: " & _
tp.IncrementalSearch.DTE.FullName)
MsgBox("Search pattern length: " & _
tp.IncrementalSearch.Pattern.Length)
' Perform incremental search using the pattern ("a").
tp.IncrementalSearch.SearchWithLastPattern()
' After the search, exit incremental search mode.
MsgBox("DeleteCharAndBackup")
tp.IncrementalSearch.DeleteCharAndBackup()
MsgBox("SearchForward")
tp.IncrementalSearch.SearchForward()
MsgBox("SearchBackward")
tp.IncrementalSearch.SearchBackward()
MsgBox("Exit")
tp.IncrementalSearch.Exit()
End Sub
.NET Framework セキュリティ
- 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。