private void ScanGamesThread(object obj) { ScanCls c = (ScanCls)obj; DoStatusUpdate("Scanning Active Directory...", string.Empty, 0, 1, 0, 1); ScanGamesInternal(c.Path, true, c.Path); if (!string.IsNullOrEmpty(c.InactivePath)) { DoStatusUpdate("Scanning Inactive Directory...", string.Empty, 0, 1, 0, 1); ScanGamesInternal(c.InactivePath, false, c.InactivePath); } int ccnt = 1; foreach (Iso i in isos) { if (Abort) { break; } DoStatusUpdate(string.Format("Scanning {2} ISO ({0}/{1})", ccnt, isos.Count, i.active ? "Active" : "Inactive"), string.Empty, ccnt, isos.Count, 0, 1); ScanIso(i.iso, c.NoXml, i.path, i.active, i.basepath); DoStatusUpdate(string.Format("Scanning {2} ISO ({0}/{1})", ccnt, isos.Count, i.active ? "Active" : "Inactive"), string.Empty, ccnt, isos.Count, 1, 1); ccnt++; } if (OnScanFinish != null) { OnScanFinish(); } Finished = true; }
public void ScanGames(string path, string inactivepath, bool noxml) { isos = new List <Iso>(); Abort = false; Finished = false; _cnt = 0; ScanCls s = new ScanCls(); s.Path = path; s.NoXml = noxml; s.InactivePath = inactivepath; Thread th = new Thread(ScanGamesThread); th.Start(s); }