Inheritance: System.Windows.Forms.Form
Beispiel #1
0
 //Handles SettingDialog.IntervalChanged
 private void TimerInterval_Changed(object sender, AppendSettingDialog.IntervalChangedEventArgs e)
 {
     if (!TimerTimeline.Enabled) return;
     ResetTimers = e;
 }
Beispiel #2
0
        private DialogResult ShowSettingDialog(bool showTaskbarIcon = false)
        {
            DialogResult result = DialogResult.Abort;

            using (var settingDialog = new AppendSettingDialog())
            {
                settingDialog.Icon = this.MainIcon;
                settingDialog.Owner = this;
                settingDialog.ShowInTaskbar = showTaskbarIcon;
                settingDialog.IntervalChanged += this.TimerInterval_Changed;

                settingDialog.tw = this.tw;
                settingDialog.LoadConfig(this._cfgCommon, this._cfgLocal);

                try
                {
                    result = settingDialog.ShowDialog(this);
                }
                catch (Exception)
                {
                    return DialogResult.Abort;
                }

                if (result == DialogResult.OK)
                {
                    lock (_syncObject)
                    {
                        settingDialog.SaveConfig(this._cfgCommon, this._cfgLocal);
                    }
                }
            }

            return result;
        }