public UpdateForm(bool darkMode, string title, string message, string dwnldBtnText, string skipBtnText, string whatsNewBtnText) { InitializeComponent(); Height = 244; Text = title; boxReleaseNotes.Text = whatsNewBtnText; messageTextBox.Text = string.Format(message, UpdateChecker.LatestRelease.TagName, "v" + UpdateChecker.CurrentVersion); buttonYes.Text = dwnldBtnText; skipBtn.Text = skipBtnText; infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); DarkMode = darkMode; closeBtn.DarkMode = darkMode; if (darkMode) { buttonYes.BackColor = ThemeMan.DarkSecondColor; skipBtn.BackColor = ThemeMan.DarkSecondColor; boxReleaseNotes.BackColor = ThemeMan.DarkSecondColor; messageTextBox.BackColor = ThemeMan.DarkBackColor; messageTextBox.ForeColor = Color.White; } }
internal YesNoForm( string messageText, string yesBtnText, Image yesBtnImage, bool showNoBtn, string noBtnText, Image noBtnImage, string windowTitle, bool darkMode = false ) { InitializeComponent(); yesBtn.Text = yesBtnText.Length == 0 ? NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDYES) : yesBtnText; if (yesBtnImage != null) { yesBtn.Image = yesBtnImage; yesBtn.TextAlign = ContentAlignment.MiddleRight; yesBtn.Text = " " + yesBtn.Text; } noBtn.Text = noBtnText.Length == 0 ? NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDNO) : noBtnText; if (noBtnImage != null) { noBtn.Image = noBtnImage; noBtn.TextAlign = ContentAlignment.MiddleRight; noBtn.Text = " " + noBtn.Text; } Text = windowTitle; cancelBtn.Text = NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCANCEL); textBox.BackColor = BackColor; textBox.Text = messageText; if (showNoBtn) { noBtn.Visible = true; } else { Size = new Size(Size.Width, Size.Height - noBtn.Height - 10); } infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); DarkMode = darkMode; closeBtn.DarkMode = darkMode; if (darkMode) { yesBtn.BackColor = ThemeMan.DarkSecondColor; noBtn.BackColor = ThemeMan.DarkSecondColor; cancelBtn.BackColor = ThemeMan.DarkSecondColor; textBox.ForeColor = Color.White; textBox.BackColor = ThemeMan.DarkBackColor; } }
public OkForm(string messageText, string windowTitle, bool darkMode = false) { InitializeComponent(); Text = windowTitle; okBtn.Text = NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDOK); textBox.BackColor = BackColor; textBox.Text = messageText; infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); DarkMode = darkMode; closeBtn.DarkMode = darkMode; if (darkMode) { okBtn.BackColor = ThemeMan.DarkSecondColor; textBox.ForeColor = Color.White; textBox.BackColor = ThemeMan.DarkBackColor; } }
public DownloadForm(string url, bool darkMode, string updating, string downloading, string readyToInstall, string failed, string install) { fileName = Path.Combine(GetDownloadFolderPath(), System.IO.Path.GetFileName(url)); this.downloading = downloading; this.readyToInstall = readyToInstall; this.failed = failed; InitializeComponent(); SetDraggableControls(new List <Control>() { statusLabel }); Text = updating; statusLabel.Text = downloading; updateButton.Text = install; cancelButton.Text = NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCANCEL); infoTooltip.SetToolTip(closeBtn, NativeMan.GetMessageBoxText(NativeMan.DialogBoxCommandID.IDCLOSE) + " | Alt+F4"); DarkMode = darkMode; closeBtn.DarkMode = darkMode; progressBar1.DarkMode = darkMode; if (darkMode) { cancelButton.BackColor = ThemeMan.DarkSecondColor; updateButton.BackColor = ThemeMan.DarkSecondColor; } wc = new WebClient(); wc.DownloadProgressChanged += wc_DownloadProgressChanged; wc.DownloadFileCompleted += wc_DownloadFileCompleted; wc.DownloadFileAsync(new Uri(url), fileName); }