private void backgroundWorkerReadMatches_DoWork(object sender, DoWorkEventArgs e) { int num = 0; double matchCount = Matches.Count; foreach (var match in Matches) { DSLOGReader reader = new DSLOGReader($"{FileView.GetPath()}\\{match.Name}.dslog"); try { reader.Read(); } catch (Exception ex) { MatchReaders.Add(null); continue; } MatchReaders.Add(reader); backgroundWorkerReadMatches.ReportProgress((int)((((double)++num) / Matches.Count) * 100.0)); if (backgroundWorkerReadMatches.CancellationPending) { e.Cancel = true; return; } } }