2
0

UpdateForm.cs 1.7 KB

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