public static void TriggerUpdateWindow(Version y, Version x, String newestversion, bool forced, bool startup, bool isitfromthechangelogwindow) { if (forced && startup) { Forms.DLEngine frm = new Forms.DLEngine(newestversion, String.Format("Downloading update {0}...", newestversion, @"{0}"), null, null, 0, true); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); } else { UpdateYesNo upd = new UpdateYesNo(x, y, true, startup, isitfromthechangelogwindow); if (startup) { upd.StartPosition = FormStartPosition.CenterScreen; } else { upd.StartPosition = FormStartPosition.CenterParent; } DialogResult dialogResult = upd.ShowDialog(); upd.Dispose(); if (dialogResult == DialogResult.Yes) { Forms.DLEngine frm = new Forms.DLEngine(newestversion, String.Format("Downloading update {0}...", newestversion, @"{0}"), null, null, 0, false); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); } } }
private void UDBLi_Click(object sender, EventArgs e) { DialogResult dialogResultR = MessageBox.Show("Do you want to update/restore the default blacklist?", "Restore the default blacklist", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResultR == DialogResult.Yes) { Program.DebugToConsole(false, "Downloading the default blacklist", null); string dbl = "https://raw.githubusercontent.com/KaleidonKep99/Keppy-s-Synthesizer/master/output/keppysynth.dbl"; Forms.DLEngine frm = new Forms.DLEngine(null, "Downloading the default blacklist", dbl, Path.GetDirectoryName(DefBlacklistPath), 2, false); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); } }
private void DefBlackListEdit_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { if (Control.ModifierKeys == Keys.Shift) { DialogResult dialogResultR = MessageBox.Show("Do you want to restore the default blacklist?", "Restore the default blacklist", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dialogResultR == DialogResult.Yes) { Program.DebugToConsole(false, "Downloading the default blacklist", null); string dbl = "https://raw.githubusercontent.com/KaleidonKep99/Keppy-s-Synthesizer/master/output/keppysynth.dbl"; Forms.DLEngine frm = new Forms.DLEngine(null, "Downloading the default blacklist", dbl, Path.GetDirectoryName(DefBlacklistPath), 1, false); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(); } } else { DialogResult dialogResult = MessageBox.Show("Are you sure you want to edit the default list?\nThis is not recommended.\n\n(If you still want to edit it, it's recommended to open the file with Notepad++)", "Editing the default blacklist", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (dialogResult == DialogResult.Yes) { System.Diagnostics.Process process = null; System.Diagnostics.ProcessStartInfo processStartInfo; processStartInfo = new System.Diagnostics.ProcessStartInfo(); processStartInfo.FileName = "notepad.exe"; processStartInfo.Arguments = DefBlacklistPath; processStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; processStartInfo.UseShellExecute = true; try { process = System.Diagnostics.Process.Start(processStartInfo); process.WaitForExit(); } catch { } finally { if (process != null) { process.Dispose(); } } } } }