private void ReportProgress(BackgroundIndexer worker, string path) { if (worker.CancellationPending) { throw new OperationCanceledException(); } worker.ReportProgressInCurrentThread(path); }