Beispiel #1
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            ChangeCase.EnableShortCuts(false);

            var config = Settings.Default;

            config.enableShortCuts               = CbxEnableShortcuts.Checked;
            config.firstItemInContextMenu        = CbxFirstInContenxtMenu.Checked;
            config.showChangeCaseOptionInHomeTab = CbxShowInHome.Checked;
            config.showChangeCaseTab             = CbxShowInHome.Checked;

            config.ScUpperCase     = CbUc.SelectedItem.ToString();
            config.ScLowerCase     = CbLc.SelectedItem.ToString();
            config.ScSentenceCase  = CbSc.SelectedItem.ToString();
            config.ScProperCase    = CbPc.SelectedItem.ToString();
            config.ScToggleCase    = CbTc.SelectedItem.ToString();
            config.ScAlternateCase = CbAc.SelectedItem.ToString();

            config.Save();

            ChangeCase.EnableShortCuts(config.enableShortCuts);

            MessageBox.Show(Resources.SettingsSaved, Resources.ProductName);
            ChangeCase.RefreshControls();
            Close();
        }
Beispiel #2
0
        private void BtnDefault_Click(object sender, EventArgs e)
        {
            var restoreConfirmation = MessageBox.Show(Resources.MyCcSettings_BtnDefault_Click_Confirmation, Resources.WindowTitle, MessageBoxButtons.YesNo);

            if (restoreConfirmation != DialogResult.Yes)
            {
                return;
            }
            ChangeCase.RestoreSettings();
            MessageBox.Show(Resources.SettingsRestored, Resources.WindowTitle);
            ChangeCase.RefreshControls();
            Close();
        }