SimpleEpub2.SettingsObject.writeToSettings C# (CSharp) Method

writeToSettings() public method

public writeToSettings ( Settings sts ) : void
sts Settings
return void
        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");
        }

Usage Example

コード例 #1
0
ファイル: MainForm.cs プロジェクト: henryxrl/SimpleEpub2
 private void sts_pg4_settings4_3_reset_button_Click(object sender, EventArgs e)
 {
     DialogResult dialogResult = MessageBoxEx.Show(this,
         LANG.getString("event_setting_reset"),
         LANG.getString("event_setting_reset_title"),
         MessageBoxButtons.YesNo);
     if (dialogResult == DialogResult.Yes)
     {
         stsObj = null;
         stsObj = new SettingsObject(settingsPath);
         stsObj.writeToSettings(sts);
     }
 }
All Usage Examples Of SimpleEpub2.SettingsObject::writeToSettings