public override void Work() { while (runners.Length > currentRunner) { RunnerBase runner = runners[currentRunner]; if (currentRunner > 0) { runner.previousRunner = runners[currentRunner - 1]; } runner.Begin(); while (runner.thread.IsAlive) { Thread.Sleep(100); } currentRunner++; } }
private void OnFileExploreDone(object sender, EventArgs e) { if (((FileExploreDoneArgs)e).ID.Equals(currentScanID)) { UnregisterHooks(); runner = null; if (status != null) status.Text = string.Format(Constants.GENERIC_WINDOW_SEARCH_STATE, found, "Done"); if (ExploreDoneCallback != null) ExploreDoneCallback(); } }
public void Initialize() { if (fileList != null) fileList.Nodes.Clear(); // Clear existing nodes. // Do not continue without the CASC engine. if (!Program.IsCASCReady) return; found = 0; // Reset found counter. // File exploration hooks! EventManager.FileExploreHit += OnFileExploreHit; EventManager.FileExploreDone += OnFileExploreDone; if (status != null) status.Text = string.Format(Constants.GENERIC_WINDOW_SEARCH_STATE, 0, "Preparing..."); currentScan++; currentScanID = string.Format(runnerID, currentScan); string filter = hardFilter; if (searchField != null) { string fieldText = searchField.Text.Trim(); if (fieldText.Length > 0) filter = fieldText.ToLower(); } runner = new RunnerFileExplore(currentScanID, extensions, filter, rootFolders); runner.Begin(); }