//将配置信息保存 private void saveBtn_Click(object sender, EventArgs e) { ConfigAppSettings.SetValue("image1DisplayTime", delay1.Value.ToString()); ConfigAppSettings.SetValue("image1DisableTime", delay2.Value.ToString()); ConfigAppSettings.SetValue("group1Name", group1Name.Text); ConfigAppSettings.SetValue("group2Name", group2Name.Text); ConfigAppSettings.SetValue("information", informationInput.Text); //同时退出界面 this.Close(); }
private void loadFromAppSetting() { int interval1; int.TryParse(ConfigAppSettings.GetValue("image1DisplayTime"), out interval1); int interval2; int.TryParse(ConfigAppSettings.GetValue("image1DisableTime"), out interval2); delay1.Value = interval1; delay2.Value = interval2; //读取信息 informationInput.Text = ConfigAppSettings.GetValue("information"); group1Name.Text = ConfigAppSettings.GetValue("group1Name"); group2Name.Text = ConfigAppSettings.GetValue("group2Name"); }
/// <summary> /// 初始化定时器 /// </summary> private void initTimer() { timer1.Stop(); timer3Focus.Stop(); waitChooseTime.Stop(); // 加载必读信息 int interval1 = 1000; int intervalFocusPoint = 500; this.image1DisableTime = 300; int.TryParse(ConfigAppSettings.GetValue("image1DisplayTime"), out interval1); int.TryParse(ConfigAppSettings.GetValue("image1DisableTime"), out this.image1DisableTime); // 设置定时器的间隔 timer1.Interval = interval1; timer3Focus.Interval = intervalFocusPoint; waitChooseTime.Interval = 3000; }
/// <summary> /// 加载必读信息 /// </summary> private void loadInformation() { this.informationText.Text = ConfigAppSettings.GetValue("information"); this.informationText.Enabled = false; this.informationText.Visible = true; }