private void FormSetting_Load(object sender, EventArgs e) { YoponSetting.Load(); var options = YoponSetting.I; checkBox1.Checked = options.HasBlockIllegalAction; checkBox2.Checked = options.HasSaveChatLog; checkBox3.Checked = options.HasSaveSlashMessage; checkBox4.Checked = options.HasProcessFormat; checkBox5.Checked = options.HideSandboxError; textBox1.Text = options.LogFormat; }
public static void Load() { if (File.Exists(ConfigFile)) { System.IO.Directory.CreateDirectory(Directory); var serializer = new XmlSerializer <YoponSetting>(); I = serializer.Deserialize(ConfigFile); } if (I == null) { I = new YoponSetting(); } }
private void button1_Click(object sender, EventArgs e) { var options = YoponSetting.I; options.HasBlockIllegalAction = checkBox1.Checked; options.HasSaveChatLog = checkBox2.Checked; options.HasSaveSlashMessage = checkBox3.Checked; options.HasProcessFormat = checkBox4.Checked; options.HideSandboxError = checkBox5.Checked; options.LogFormat = textBox1.Text; YoponSetting.Save(); if (sender != null) { Close(); } }
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) { YoponSetting.Save(); }