EdgeForm.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. using System.IO;
  11. namespace Optimizer
  12. {
  13. public partial class EdgeForm : System.Windows.Forms.Form
  14. {
  15. string errormsg = "This folder does not exist, choose a new one!";
  16. public EdgeForm()
  17. {
  18. InitializeComponent();
  19. Options.ApplyTheme(this);
  20. }
  21. private void EdgeFolder_Load(object sender, EventArgs e)
  22. {
  23. CheckForIllegalCrossThreadCalls = false;
  24. textBox1.Text = Optimize.GetEdgeDownloadFolder();
  25. textBox1.Select(textBox1.Text.Length, 0);
  26. }
  27. private void ok_Click(object sender, EventArgs e)
  28. {
  29. if (Directory.Exists(textBox1.Text))
  30. {
  31. Optimize.SetEdgeDownloadFolder(textBox1.Text);
  32. this.Close();
  33. }
  34. else
  35. {
  36. MessagerForm f = new MessagerForm(null, MessagerType.Error, errormsg);
  37. f.ShowDialog();
  38. }
  39. }
  40. private void cancel_Click(object sender, EventArgs e)
  41. {
  42. this.Close();
  43. }
  44. }
  45. }