Update SelectForm.cs

This commit is contained in:
pointfeev 2021-11-30 11:48:51 -05:00
parent 43e8b64349
commit 7370decf56
No known key found for this signature in database
GPG key ID: AA14DC36C4D7D13C

View file

@ -9,7 +9,6 @@ using System.Diagnostics;
using System.Drawing; using System.Drawing;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
@ -236,11 +235,6 @@ namespace CreamInstaller
task.Wait(); task.Wait();
} }
progress.Report(RunningTasks.Count); progress.Report(RunningTasks.Count);
ProgramSelection.All.ForEach(selection => selection.SteamApiDllDirectories.RemoveAll(directory => !Directory.Exists(directory)));
ProgramSelection.All.RemoveAll(selection => !Directory.Exists(selection.RootDirectory) || !selection.SteamApiDllDirectories.Any());
foreach (TreeNode treeNode in treeNodes)
if (treeNode.Parent is null && ProgramSelection.FromAppId(int.Parse(treeNode.Name)) is null)
treeNode.Remove();
} }
private async void OnLoad() private async void OnLoad()
@ -289,6 +283,11 @@ namespace CreamInstaller
setup = false; setup = false;
label2.Text = "Gathering and caching your applicable games and their DLCs . . . "; label2.Text = "Gathering and caching your applicable games and their DLCs . . . ";
await Task.Run(() => GetCreamApiApplicablePrograms(iProgress)); await Task.Run(() => GetCreamApiApplicablePrograms(iProgress));
ProgramSelection.All.ForEach(selection => selection.SteamApiDllDirectories.RemoveAll(directory => !Directory.Exists(directory)));
ProgramSelection.All.RemoveAll(selection => !Directory.Exists(selection.RootDirectory) || !selection.SteamApiDllDirectories.Any());
foreach (TreeNode treeNode in treeNodes)
if (treeNode.Parent is null && ProgramSelection.FromAppId(int.Parse(treeNode.Name)) is null)
treeNode.Remove();
//SetMinimumSizeFromTreeView(); //SetMinimumSizeFromTreeView();
progressBar1.Value = 100; progressBar1.Value = 100;