public void loadFromSettings(Settings sts) { coverFirstPage = sts.pg1.settings1_3_coverfirstpage.Value; coverNoTOC = sts.pg1.settings1_3_covernoTOC.Value; verticalText = sts.pg1.settings1_3_vertical.Value; replaceNumByHan = sts.pg1.settings1_3_replace.Value; StT = sts.pg1.settings1_3_StT.Value; TtS = sts.pg1.settings1_3_TtS.Value; embedFontSubset = sts.pg1.settings1_3_embedFontSubset.Value; generateMOBI = sts.pg1.settings1_3_generateMOBI.Value; bookNameFont = sts.pg2.settings2_3_booknamefont.Text; authorNameFont = sts.pg2.settings2_3_authornamefont.Text; pageColor = sts.pg2.settings2_1_pc.SelectedColor; marginT = Int32.Parse(sts.pg2.settings2_2_pmT.Text); marginB = Int32.Parse(sts.pg2.settings2_2_pmB.Text); marginL = Int32.Parse(sts.pg2.settings2_2_pmL.Text); marginR = Int32.Parse(sts.pg2.settings2_2_pmR.Text); titleFont = sts.pg3.settings3_1_tfont.Text; titleColor = sts.pg3.settings3_1_tcolor.SelectedColor; bodyFont = sts.pg3.settings3_2_bfont.Text; bodyColor = sts.pg3.settings3_2_bcolor.SelectedColor; lineSpacing = Int32.Parse(sts.pg3.settings3_3_linespacing.Text); addParagraphSpacing = sts.pg3.settings3_3_addparagraphspacing.Value; dropCap = sts.pg3.settings3_3_dropCap.Value; stickupCap = sts.pg3.settings3_3_stickupCap.Value; fileLocation = sts.pg4.settings4_1_filelocation.Text; deleteTempFiles = sts.pg4.settings4_2_deletetempfiles.Value; autoUpdate = sts.pg4.settings4_4_chkupd.Value; language = (sts.pg4.settings4_4_language.Text.CompareTo("English") == 0) ? "en_" : ((sts.pg4.settings4_4_language.Text.CompareTo("简体中文") == 0) ? "zh_" : "null"); }
public void writeToSettings(Settings sts) { sts.pg1.settings1_3_coverfirstpage.Value = coverFirstPage; sts.pg1.settings1_3_covernoTOC.Value = coverNoTOC; if (!sts.pg1.settings1_3_coverfirstpage.Value) { sts.pg1.settings1_3_covernoTOC.Value = false; sts.pg1.settings1_3_covernoTOC.Enabled = false; } sts.pg1.settings1_3_vertical.Value = verticalText; sts.pg1.settings1_3_replace.Value = replaceNumByHan; sts.pg1.settings1_3_StT.Value = StT; sts.pg1.settings1_3_TtS.Value = TtS; if (sts.pg1.settings1_3_StT.Value) { sts.pg1.settings1_3_TtS.Value = false; sts.pg1.settings1_3_TtS.Enabled = false; } if (sts.pg1.settings1_3_TtS.Value) { sts.pg1.settings1_3_StT.Value = false; sts.pg1.settings1_3_StT.Enabled = false; } sts.pg1.settings1_3_embedFontSubset.Value = embedFontSubset; sts.pg1.settings1_3_generateMOBI.Value = generateMOBI; sts.pg2.settings2_3_booknamefont.Text = bookNameFont; sts.pg2.settings2_3_authornamefont.Text = authorNameFont; sts.pg2.settings2_1_pc.SelectedColor = pageColor; sts.pg2.settings2_2_pmT.Text = marginT.ToString(); sts.pg2.settings2_2_pmB.Text = marginB.ToString(); sts.pg2.settings2_2_pmL.Text = marginL.ToString(); sts.pg2.settings2_2_pmR.Text = marginR.ToString(); sts.pg3.settings3_1_tfont.Text = titleFont; sts.pg3.settings3_1_tcolor.SelectedColor = titleColor; sts.pg3.settings3_2_bfont.Text = bodyFont; sts.pg3.settings3_2_bcolor.SelectedColor = bodyColor; sts.pg3.settings3_3_linespacing.Text = lineSpacing.ToString(); sts.pg3.settings3_3_addparagraphspacing.Value = addParagraphSpacing; sts.pg3.settings3_3_dropCap.Value = dropCap; sts.pg3.settings3_3_stickupCap.Value = stickupCap; if (sts.pg3.settings3_3_dropCap.Value) { sts.pg3.settings3_3_stickupCap.Value = false; sts.pg3.settings3_3_stickupCap.Enabled = false; } if (sts.pg3.settings3_3_stickupCap.Value) { sts.pg3.settings3_3_dropCap.Value = false; sts.pg3.settings3_3_dropCap.Enabled = false; } sts.pg4.settings4_1_filelocation.Text = fileLocation; sts.pg4.settings4_2_deletetempfiles.Value = deleteTempFiles; sts.pg4.settings4_4_chkupd.Value = autoUpdate; sts.pg4.settings4_4_language.Text = (language.CompareTo("en_") == 0) ? "English" : ((language.CompareTo("zh_") == 0) ? "简体中文" : "null"); }
private void setSettings(Boolean show) { SuspendLayout(); sts = new Settings(themeColor, LANG, DPI); sts.IsOpen = true; sts.SetBounds(8, 8, sts.Width, sts.Height); if (!show) sts.IsOpen = false; Controls.Add(sts); if (!show) sts.SendToBack(); else sts.BringToFront(); sts.SlideSide = DevComponents.DotNetBar.Controls.eSlideSide.Top; sts.Parent = this; sts.IsOpenChanged += sts_IsOpenChanged; sts.pg1.settings1_3_vertical.ValueChanged += sts_pg1_settings1_3_vertical_ValueChanged; sts.pg2.settings2_3_booknamefont.TextChanged += sts_pg2_settings2_3_booknamefont_TextChanged; sts.pg2.settings2_3_authornamefont.TextChanged += sts_pg2_settings2_3_authornamefont_TextChanged; sts.pg4.settings4_4_chkupd_button.Click += sts_pg4_settings4_4_chkupd_button_Click; sts.pg4.settings4_3_reset_button.Click += sts_pg4_settings4_3_reset_button_Click; ResumeLayout(false); }