Exemplo n.º 1
0
        public override void SaveSettingsToStorage()
        {
            base.SaveSettingsToStorage();

            var oldOpt = new OptionValues();

            oldOpt.LoadSettingsFromStorage();

            #region save options

            // HACK: 2.3. ダイアログからオプションへ値を設定する
            var newOpt = new OptionValues
            {
                RightMargin              = Math.Max(0, Math.Min(RightMargin, 1024)),
                VisibleLineBreakMode     = VisibleLineBreakMode,
                IsEnabledLineIndicator   = IsEnabledLineIndicator,
                IsEnabledColumnIndicator = IsEnabledColumnIndicator,
                IsLockedWheelZoom        = IsLockedWheelZoom,
            };

            #endregion

            newOpt.SaveSettingsToStorage();

            var changedOptions = UpdateNames(oldOpt, newOpt)
                                 .ToArray();

            if (!changedOptions.IsEmpty())
            {
                var e = new OptionEventArgs(newOpt, new ReadOnlyCollection <string>(changedOptions));
                OptionObserver.OnOptionChanged(e);
            }
        }
Exemplo n.º 2
0
 public static void OnOptionChanged(OptionEventArgs e)
 {
     OptionChanged?.Invoke(null, e);
 }