ITextSearchService2.Find Method (SnapshotPoint, String, FindOptions)
Searches for the next occurrence of the given search pattern, using the given starting position and options.
Namespace: Microsoft.VisualStudio.Text.Operations
Assembly: Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)
Syntax
'宣告
Function Find ( _
startingPosition As SnapshotPoint, _
searchPattern As String, _
options As FindOptions _
) As Nullable(Of SnapshotSpan)
Nullable<SnapshotSpan> Find(
SnapshotPoint startingPosition,
string searchPattern,
FindOptions options
)
Nullable<SnapshotSpan> Find(
SnapshotPoint startingPosition,
String^ searchPattern,
FindOptions options
)
abstract Find :
startingPosition:SnapshotPoint *
searchPattern:string *
options:FindOptions -> Nullable<SnapshotSpan>
function Find(
startingPosition : SnapshotPoint,
searchPattern : String,
options : FindOptions
) : Nullable<SnapshotSpan>
Parameters
- startingPosition
Type: Microsoft.VisualStudio.Text.SnapshotPoint
[in] The position from which to begin the search.
- searchPattern
Type: System.String
[in] The text pattern to search for.
- options
Type: Microsoft.VisualStudio.Text.Operations.FindOptions
[in] Options to use for the search.
Return Value
Type: System.Nullable<SnapshotSpan>
Returns the text span containing the match if a match was found; otherwise, returns nulla null reference (Nothing in Visual Basic) if no matches were found.
Remarks
This method is safe to be executed on any thread.
ArgumentException if the UseRegularExpressions option is set and the search string is an invalid regular expression.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.