UpdateForm.cs 1.7 KB

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