private void ShowError(Exception ex, bool silent = false) { if (silent) { this.tslnkError.Visible = true; this.tslnkError.Tag = ex; } else { using (frmError error = new frmError(ex)) { error.ShowDialog(); } } }
private void btnOK_Click(object sender, EventArgs e) { try { if (this.chkWarnMe.Checked) { this.WarnUserOnNonRecommended(); } Settings.Default.WarnOnNonRecommended = this.chkWarnMe.Checked; Settings.Default.AppCloseAction = this.cmbCloseAction.SelectedIndex; Settings.Default.HideIcon = this.chkHideMe.Checked; Settings.Default.RememberProcesses = this.chkRemember.Checked; Settings.Default.AutoSelect = this.chkAutoSelect.Checked; Settings.Default.CheckUpdates = this.chkCheckUpdates.Checked; Settings.Default.StartHidden = this.chkStartHidden.Checked; Settings.Default.HideWhenScreenSaverActivates = this.chkHideOnScreenSaver.Checked; HotkeyManager.HideHotkey.Hotkeys = this._hideKey; HotkeyManager.ShowHotkey.Hotkeys = this._showKey; HotkeyManager.KillHotkey.Hotkeys = this._killKey; Settings.Default.HideHotkey = this._hideKey; Settings.Default.ShowHotkey = this._showKey; Settings.Default.KillHotKey = this._killKey; this.SetAutoStart(this.chkAutoStart.Checked); Settings.Default.Save(); } catch (Exception exception1) { using (frmError error = new frmError(exception1)) { error.ShowDialog(); } base.DialogResult = DialogResult.None; Settings.Default.Reload(); } }