private void MenuFilePreferences_Click(object sender, EventArgs e) { int tasks = Configuration.MaxConcurrentTasks; SettingsForm.Show(this); for (int i = tasks; i < Configuration.MaxConcurrentTasks; i++) { AddTaskScheduler(); } for (int i = Configuration.MaxConcurrentTasks; i < tasks; i++) { RemoveTaskScheduler(ProgressList.OrderBy(p => p.Tasks.Count).LastOrDefault()); } }