private void dialogButton_DialogButtonClick(object sender, Controls.DialogButton.DialogButtonClickEventArgs e) { DialogResult = e.Result; if (e.Result == DialogResult.OK) { Config.BackupMode = (EBackupMode)_ComboBoxHelper.GetValue(); Config.BackupLocation = textBoxLocation.Text; } Close(); }
private void CbDefaultType_SelectedIndexChanged(object sender, EventArgs e) { int _value = _defaultTypeComboBoxHelper.GetValue(); if (_value == (int)CodeType.RTF) { rtf.Left = tbCode.Left; rtf.Top = tbCode.Top; rtf.Width = tbCode.Width; rtf.Height = tbCode.Height; rtf.Visible = true; tbCode.Visible = false; } else { tbCode.Visible = true; rtf.Visible = false; } }
private void dialogButton_DialogButtonClick(object sender, Controls.DialogButton.DialogButtonClickEventArgs e) { DialogResult = e.Result; if (e.Result == DialogResult.OK) { Config.Theme = (ETheme)_ComboBoxHelper.GetValue(); if (rbSortA.Checked) { Config.SortMode = ESortMode.Alphabetic; } if (rbSortB.Checked) { Config.SortMode = ESortMode.AlphabeticGrouped; } } Close(); }
private void DialogButton_DialogButtonClick(object sender, DialogButton.DialogButtonClickEventArgs e) { RichTextBox _richTextBox = new RichTextBox(); _themeHelper.RichTextBoxTheme(_richTextBox); CodeType _newType = (CodeType)_typeComboBoxHelper.GetValue(); CodeType _oldType = Snippet.CodeType; DialogResult = e.Result; if (e.Result == DialogResult.OK) { Snippet.DefaultChildCodeType = (CodeType)_defaultTypeComboBoxHelper.GetValue(); Snippet.CodeType = _newType; bool _changed = false; if (_newType == CodeType.RTF && _oldType != CodeType.RTF) { _richTextBox.Text = Snippet.GetCode(); Snippet.SetRtf(_richTextBox.Rtf, out _changed); } else if (_oldType == CodeType.RTF && _newType != CodeType.RTF) { _richTextBox.Rtf = Snippet.GetRTF(); Snippet.SetCode(_richTextBox.Text, out _changed); } Snippet.DefaultChildName = tbName.Text ?? string.Empty; Snippet.SetDefaultChildCode(tbCode.Text ?? string.Empty, out _changed); if (Snippet.DefaultChildCodeType == CodeType.RTF) { if (!string.IsNullOrEmpty(rtf.Text)) { Snippet.SetDefaultChildRtf(rtf.Rtf, out _changed); } } else { Snippet.SetDefaultChildRtf(string.Empty, out _changed); } Snippet.DefaultChildCodeTypeEnabled = checkBoxCodeType.Checked; Snippet.Expanded = cbExpand.Checked; Snippet.Important = cbImportant.Checked; Snippet.AlarmActive = cbAlarm.Checked; Snippet.Wordwrap = cbWordWrap.Checked; Snippet.HtmlPreview = cbHtmlPreview.Checked; if (Snippet.AlarmActive) { Snippet.AlarmDate = datePicker.Value.Date.Add(timeControl.Value.TimeOfDay); } else { Snippet.AlarmDate = null; } Keys _keys = (Keys)_shortCutKeysComboHelper.GetValue(); _keys = _keys & ~Keys.Control; _keys = _keys & ~Keys.Alt; _keys = _keys & ~Keys.Shift; if (cbControl.Checked) { _keys = _keys | Keys.Control; } if (cbShift.Checked) { _keys = _keys | Keys.Shift; } if (cbAlt.Checked) { _keys = _keys | Keys.Alt; } Snippet.ShortCutKeys = _keys; } Close(); }