SettingsForm.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 FactorioModManager
  11. {
  12. public partial class SettingsForm : Form
  13. {
  14. public SettingsForm()
  15. {
  16. InitializeComponent();
  17. }
  18. private void Button1_Click(object sender, EventArgs e)
  19. {
  20. Properties.Settings.Default.autoUpdateMods = checkBox2.Checked;
  21. Properties.Settings.Default.autoLoadInfo = checkBox1.Checked;
  22. Properties.Settings.Default.saveToken = checkBox3.Checked;
  23. Properties.Settings.Default.Save();
  24. }
  25. private void SettingsForm_Load(object sender, EventArgs e)
  26. {
  27. checkBox2.Checked = Properties.Settings.Default.autoUpdateMods;
  28. checkBox1.Checked = Properties.Settings.Default.autoLoadInfo;
  29. checkBox3.Checked = Properties.Settings.Default.saveToken;
  30. }
  31. private void SettingsForm_FormClosing(object sender, FormClosingEventArgs e)
  32. {
  33. Properties.Settings.Default.autoUpdateMods = checkBox2.Checked;
  34. Properties.Settings.Default.autoLoadInfo = checkBox1.Checked;
  35. Properties.Settings.Default.saveToken = checkBox3.Checked;
  36. Properties.Settings.Default.Save();
  37. }
  38. private void CheckBox1_CheckedChanged(object sender, EventArgs e)
  39. {
  40. if (!checkBox1.Checked) checkBox2.Checked = false;
  41. }
  42. }
  43. }