/// <summary> /// /// </summary> private void SaveConfig() { SampleConfig config = Lemon.GetExtendConfig <SampleConfig>(); config.FieldString = this.textBox1.Text; config.FieldInt = int.Parse(this.textBox2.Text); config.FieldDate = DateTime.Parse(this.textBox3.Text); config.FieldDouble = double.Parse(this.textBox4.Text); config.CoffeeSet.Bitter = int.Parse(this.textBox5.Text); config.CoffeeSet.Puckery = int.Parse(this.textBox6.Text); config.CoffeeSet.Smell = int.Parse(this.textBox7.Text); config.CoffeeSet.Sour = int.Parse(this.textBox8.Text); Lemon.SaveExtendConfig <SampleConfig>(config); }
/// <summary> /// /// </summary> private void ReadConfig() { SampleConfig config = Lemon.GetExtendConfig <SampleConfig>(); this.textBox1.Text = config.FieldString; this.textBox2.Text = config.FieldInt.ToString(); this.textBox3.Text = config.FieldDate.ToString(); this.textBox4.Text = config.FieldDouble.ToString(); this.textBox5.Text = config.CoffeeSet.Bitter.ToString(); this.textBox6.Text = config.CoffeeSet.Puckery.ToString(); this.textBox7.Text = config.CoffeeSet.Smell.ToString(); this.textBox8.Text = config.CoffeeSet.Sour.ToString(); foreach (Coffee cf in config.CoffeeSetList) { this.textBox9.Text += cf.Bitter.ToString() + "," + cf.Puckery.ToString() + "," + cf.Smell.ToString() + "," + cf.Sour.ToString(); } }