public InfoControl() { InitializeComponent(); _infoDesign = new InfoModuleDesign(); _ic = new InfoConfig(); _ic.ZoomFactor = 1; }
public bool ShowImageConfig(InfoConfig ic, string sectionName, IWin32Window owner) { IsOk = false; _ic = ic; _sectionName = sectionName; this.ShowDialog(owner); return(IsOk); }
public override void ModuleLoaded() { _ic = InfoConfig.GetConfig(_moduleName); if (_ic.ZoomFactor <= 0) { _ic.ZoomFactor = 1; } richTextBox1.ZoomFactor = _ic.ZoomFactor; base.ModuleLoaded(); }
private void butSure_Click(object sender, EventArgs e) { try { _ic.ZoomFactor = (float)Convert.ToDouble(txtZoomFactor.Text); InfoConfig.SetConfig(_ic, _sectionName); IsOk = true; this.Close(); } catch (Exception Ex) { MessageBox.Show(Ex.Message); } }
static public void SetConfig(InfoConfig ic, string sectionName) { SettingItem imageSetting = AppSettingHelper.GetSpecifySection(sectionName); imageSetting.BatchBegin(); try { imageSetting.WriteDouble("ZoomFactor", ic.ZoomFactor); imageSetting.BatchCommit(); } catch (Exception ex) { imageSetting.BatchCancel(); MsgBox.ShowException(ex); } }
static public InfoConfig GetConfig(string sectionName) { InfoConfig ic = new InfoConfig(); try { SettingItem imageSetting = AppSettingHelper.GetSpecifySection(sectionName); ic.ZoomFactor = (float)imageSetting.ReadDouble("ZoomFactor"); } catch (Exception ex) { MsgBox.ShowException(ex); } return(ic); }