private void DownloadPatch_DoWork(object sender, DoWorkEventArgs e) //When select extras window is activated { DownloadPatch(); if (DownloadPatchWorker.CancellationPending) { InstallActions.Cleanup(); return; } progressBar1.Value = 100; InstallActions.ZipProgressChanged += (f) => { progressBar1.Value = f; }; InstallActions.TempExtractPatch(); InstallActions.ZipProgressChanged -= (f) => { progressBar1.Value = f; }; if (!DownloadPatchWorker.CancellationPending) { if (InstallActions.err_ARCHIVE) { page1.Visible = true; page2patched.Visible = false; return; } extrasListBox.DataSource = InstallActions.DetectExtras(); if (File.Exists(SteamSkinPath + InstallActions.SkinFolder + "\\extras.txt")) { string[] savedExtras = File.ReadAllLines(SteamSkinPath + InstallActions.SkinFolder + "\\extras.txt"); for (int i = 0; i < extrasListBox.Items.Count; i++) { if (savedExtras.Contains(extrasListBox.Items[i])) { extrasListBox.SetItemChecked(i, true); } } if (savedExtras.Length > 0) { saveExtrasCheckBox.Checked = true; } } progressBar1.Visible = false; extrasLoadingText.Visible = false; saveExtrasCheckBox.Invoke((MethodInvoker)(() => { saveExtrasCheckBox.Visible = true; })); PatchInstallButton.Enabled = true; PatchInstallButton.ForeColor = Color.White; PatchInstallButton.Image = Properties.Resources.right_arrow; } else { InstallActions.Cleanup(); } }
private void DownloadPatch_DoWork(object sender, DoWorkEventArgs e) //When select extras window is activated { DownloadPatch(); progressBar1.Value = 100; InstallActions.TempExtractPatch(); if (InstallActions.err_ARCHIVE) { page1.Visible = true; page2patched.Visible = false; return; } extrasListBox.DataSource = InstallActions.DetectExtras(); progressBar1.Visible = false; extrasLoadingText.Visible = false; PatchInstallButton.Enabled = true; PatchInstallButton.ForeColor = Color.White; PatchInstallButton.Image = Properties.Resources.right_arrow; }