SearchEngine.OnFileFound Event

Top  Previous  Next

Occurs when one or more files are found.

 

[Visual Basic]

 

Public Event OnFileFound(ByVal listFileFound As SearchResultItemList)

 

 

 

Event Data

 

The event handler receives an argument of type SearchResultItemList containing one or objects of type SearchResultItem.

 

Remarks

 

The OnFileFound event is not fired for each individual file found. Instead, for performance reasons, it is fired at given intervals (approx. 250ms) if files are found during the interval. The SearchResultItemList argument contains the list of files found and is a subset of the list returned when calling the Start method.

 

Example

 

[Visual Basic]

 

 Private Sub SearchEngine_OnFileFound(ByVal listFound As SearchResultItemList) Handles m_engineSearch.OnFileFound

 

 ' Received when one or more files has been found. A list of files found since the

 ' last OnFileFound message are in the parameter listFound.

 

 Dim buildText As New System.Text.StringBuilder

 

 For nItem As Integer = 0 To (listFound.Count - 1)

         ' Each item in the list includes information about the found

         ' item (e.g. its name and path) and also the list of text lines

         ' found if this was a content search

 

         Dim item As SearchResultItem = listFound(nItem)

 

         buildText.Append(item.Path)

         buildText.Append(item.FileName)

         buildText.Append(vbCrLf)

 

         Next

 

         System.Console.Write( buildText.ToString() )

 End Sub


Copyright © 2003-2013 Mythicsoft Ltd. All rights reserved.
SDK help file version: 7.0.2