UpdateForm.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System;
  2. using System.Drawing;
  3. using System.Windows.Forms;
  4. namespace Optimizer
  5. {
  6. public partial class UpdateForm : Form
  7. {
  8. public UpdateForm(string message, bool newUpdate, string changelog, string latestVersion)
  9. {
  10. InitializeComponent();
  11. Options.ApplyTheme(this);
  12. txtMessage.Text = message;
  13. if (newUpdate)
  14. {
  15. this.Size = new Size(600, 545);
  16. btnOK.Text = Options.TranslationList["btnYes"].ToString();
  17. btnNo.Text = Options.TranslationList["btnNo"].ToString();
  18. btnNo.Visible = true;
  19. txtChanges.Text = Options.TranslationList["btnChangelog"].ToString();
  20. txtVersions.Text = $"{Program.GetCurrentVersionTostring()} → {latestVersion}";
  21. txtVersions.Visible = true;
  22. btnOK.DialogResult = DialogResult.Yes;
  23. btnNo.DialogResult = DialogResult.No;
  24. txtInfo.Text = changelog;
  25. txtInfo.Visible = true;
  26. txtChanges.Visible = true;
  27. }
  28. else
  29. {
  30. this.Size = new Size(600, 188);
  31. btnOK.Text = Options.TranslationList["btnAbout"].ToString();
  32. btnNo.Visible = false;
  33. txtVersions.Visible = false;
  34. btnOK.DialogResult = DialogResult.OK;
  35. txtInfo.Visible = false;
  36. txtChanges.Visible = false;
  37. }
  38. }
  39. private void UpdateForm_Load(object sender, EventArgs e)
  40. {
  41. }
  42. }
  43. }