Example #1
0
        /// <summary>
        /// 設定を動作に反映し、保存します。
        /// </summary>
        private void ApplyAndSaveSettings()
        {
            if (SettingsWrapper == null)
            {
                throw new InvalidOperationException(String.Format(IS_NULL_MESSAGE, nameof(SettingsWrapper)));
            }

            SetAlignmentFromRadioButton(out VerticalAlignment verticalAlignment, out HorizontalAlignment horizontalAlignment);
            SettingsWrapper.VerticalAlignment      = (int)verticalAlignment;
            SettingsWrapper.HorizontalAlignment    = (int)horizontalAlignment;
            SettingsWrapper.VerticalMarginNumber   = Double.Parse(VerticalMarginString);
            SettingsWrapper.HorizontalMarginNumber = Double.Parse(HorizontalMarginString);
            SettingsWrapper.IsPercentVertical      = VerticalMarginPercent;
            SettingsWrapper.IsPercentHorizontal    = HorizontalMarginPercent;
            SettingsWrapper.CustumHolidaysString   = CustomHolidaysParser.Serialize(CustomHolidaysDictionary);

            // 反映し終えたら、設定は無変更状態。
            SettingIsChanged = false;

            // 設定の保存
            SettingsWrapper.Save();
        }