private void AnalyzeFiles(object sender, DoWorkEventArgs e) { var curFileInProgress = 0.0; foreach (string filePath in _jpegFilesLocation) { curFileInProgress++; ProcessedPhoto processedPhoto = Analyzer.ProcesImage(filePath, FilterNullValues); _resultSet.AddProcessedPhoto(processedPhoto); analysisWorker.ReportProgress((int)((curFileInProgress / _jpegFilesLocation.Count) * 100)); } }