private void Stage_2() { Data.Session.Stage = 2; Thread.Sleep(250); ColorLabels(FormDesign.Design); PGB_Shortcuts.Percentage = 100; Invoke(new Action(() => { if (Data.Session.Shortcuts.Count > 0) { L_Shortcuts_Info.Text = $"Done, {Data.Session.Shortcuts.Where(x => x.Match != null).Count()} / {Data.Session.Shortcuts.Count} matches found"; } else { L_Shortcuts_Info.Text = $"Done, no Shortcuts to match"; } L_Folders_Info.ForeColor = FormDesign.Design.InfoColor; if (Data.Session.StageErrors[1] > 0) { L_Shortcuts_Info.ForeColor = FormDesign.Design.RedColor; } L_Shortcuts_Info.Text += Data.Session.StageErrors[1] == 0 ? "." : $", {Data.Session.StageErrors[1]} errors occurred."; PB_Shortcuts.Hide(); PB_Folders.Show(); })); for (int i = 0; i < (Data.Session.Folders.Count / 500).Between(1, MAX_RUNS); i++) { WorkingThreads.Add(new Action(S2_Work).RunInBackground(THREAD_PRIORITY)); } }
private void Stage_1() { Data.Session.Stage = 1; ColorLabels(FormDesign.Design); Data.Session.Icons = Data.Session.Icons.Where(x => x != null).ToList(); Data.Session.Files = Data.Session.Files.Where(x => x != null).ToList(); if (Data.Session.O_ChangeShortcuts) { Data.Session.Shortcuts.AddRange(Data.Session.Files.Where(x => x?.Type == IconType.Normal)); } if (Data.Session.O_ChangeFolders) { Data.Session.Folders.AddRange(Data.Session.Files.Where(x => x?.Type != IconType.Normal)); } Invoke(new Action(() => { PB_Icon.Image = Properties.Resources.Icon.Color(FormDesign.Design.IconColor); L_Title.Text = "Auto - Icons"; L_Title.Font = new Font("Century Gothic", 17.25F, FontStyle.Bold); L_Shortcuts_Info.ForeColor = FormDesign.Design.InfoColor; PB_Shortcuts.Show(); TaskbarProgress.SetState(Handle, TaskbarProgress.TaskbarStates.Normal); })); for (int i = 0; i < (Data.Session.Shortcuts.Count / 500).Between(1, MAX_RUNS); i++) { WorkingThreads.Add(new Action(S1_Work).RunInBackground(THREAD_PRIORITY)); } }