private void Stage_4() { Data.Session.Stage = 4; Thread.Sleep(250); ColorLabels(FormDesign.Design); PGB_SecondPass.Percentage = 100; Invoke(new Action(() => { if (Data.Session.SecondPassFolders.Count > 0) { L_SecondPass_Info.Text = $"Done, {Data.Session.SecondPassFolders.Where(x => x.Match != null).Count()} / {Data.Session.SecondPassFolders.Count} matches found."; } else { L_SecondPass_Info.Text = $"Done, no need for Second Pass."; } L_ApplyChanges_Info.ForeColor = FormDesign.Design.InfoColor; if (Data.Session.StageErrors[3] > 0) { L_SecondPass_Info.ForeColor = FormDesign.Design.RedColor; } L_SecondPass_Info.Text += Data.Session.StageErrors[3] == 0 ? "." : $", {Data.Session.StageErrors[3]} errors occurred."; PB_SecondPass.Hide(); PB_Final.Show(); })); try { BackEndWorker.CloseExplorerWindows(); } catch (Exception) { } for (int i = 0; i < (Data.Session.Files.Count / 500).Between(1, MAX_RUNS); i++) { WorkingThreads.Add(new Action(S4_Work).RunInBackground(THREAD_PRIORITY)); } }
private void Stage_3() { Data.Session.Stage = 3; Thread.Sleep(250); ColorLabels(FormDesign.Design); PGB_Folders.Percentage = 100; Invoke(new Action(() => { if (Data.Session.Folders.Count > 0) { L_Folders_Info.Text = $"Done, {Data.Session.Folders.Where(x => x.Match != null).Count()} / {Data.Session.Folders.Count} matches found"; } else { L_Folders_Info.Text = $"Done, no Folders to match"; } L_SecondPass_Info.ForeColor = FormDesign.Design.InfoColor; if (Data.Session.StageErrors[2] > 0) { L_Folders_Info.ForeColor = FormDesign.Design.RedColor; } L_Folders_Info.Text += Data.Session.StageErrors[2] == 0 ? "." : $", {Data.Session.StageErrors[2]} errors occurred."; PB_Folders.Hide(); PB_SecondPass.Show(); })); Data.Session.SecondPassFolders.AddRange(Data.Session.Folders.Where(x => x?.Match == null)); for (int i = 0; i < (Data.Session.SecondPassFolders.Count / 500).Between(1, MAX_RUNS); i++) { WorkingThreads.Add(new Action(S3_Work).RunInBackground(THREAD_PRIORITY)); } }