SearchEngine.OnProgress Event

Top  Previous  Next

Occurs at regular intervals to report search progress.

 

[Visual Basic]

 

Public Event OnProgress(ByVal nCurrentPhase As Integer, ByVal strLocation As String,

  ByVal nContentTotal As Double, ByVal nFileTotal As Double)

 

 

 

Event Data

 

The event handler receives the following arguments representing the current search progress.

 

nCurrentPhase

Value is either 1 or 2. Representing the phase of the search. Phase 1 finds all files matching the filename criteria and Phase 2 searches the contents of those files.

strLocation

String representing the current location of the search. If there is only a single search thread then this will be the full path of the current search location otherwise it will be a list of files currently being searched.

nContentTotal

The total size, in bytes, of file content that has been searched. This will always be less than or equal to nFileTotal.

nFileTotal

The total size, in bytes, of files that have currently matched the filename criteria.

 

Remarks

 

This event is fired at approximately 100ms intervals providing a snapshot of the current search progress.

 

Example

 

[Visual Basic]

 

 

 Private Const BYTES_PER_MB As Integer = 1024 * 1000

 

 Private Sub SearchEngine_OnProgress(ByVal nPhase As Integer, ByVal strLocation As String, _

                         ByVal nContentTotal As Double, ByVal nFileTotal As Double) Handles m_engineSearch.OnProgress

 

         ' Received at regular intervals during search to show the current progress of the search.

 

         LabelProgress.Text = String.Format("Phase {0} ({1:n2} of {2:n2})", _

                                                 nPhase, nContentTotal / BYTES_PER_MB, nFileTotal / BYTES_PER_MB)

         LabelLocation.Text = "Searching: " + strLocation

         LabelProgress.Refresh()

 

 End Sub


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