private void BackupCriticalSettingsButton_Click(object sender, RoutedEventArgs e) { RandomSaltTextBox.GetBindingExpression(TextBox.TextProperty).UpdateTarget(); SpecialSymbolTextBox.GetBindingExpression(TextBox.TextProperty).UpdateTarget(); Helper.SaveCriticalSettings(); MessageBox.Show(this, "Critical settings (random salt and symbol candidates) has been saved to " + Helper.CriticalSettingsBackupFileName, App.Metadata.AssemblyTitle, MessageBoxButton.OK, MessageBoxImage.Information); }
private void OKButton_Click(object sender, RoutedEventArgs e) { GeneralStackPanel.Children.ForEach ( (CheckBox element) => { element.GetBindingExpression(CheckBox.IsCheckedProperty).UpdateSource(); } ); RandomSaltTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); SpecialSymbolTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); App.Settings.Save(); this.Close(); }
private void RestoreCriticalSettingsButton_Click(object sender, RoutedEventArgs e) { if (File.Exists(Helper.CriticalSettingsBackupFileName)) { String[] criticalSettings = Helper.LoadCriticalSettings(); RandomSaltTextBox.SetCurrentValue(TextBox.TextProperty, criticalSettings[0]); SpecialSymbolTextBox.SetCurrentValue(TextBox.TextProperty, criticalSettings[1]); MessageBox.Show(this, String.Format("Critical settings (random salt and symbol candidates) has been restored from {0}{1}{1}Click OK button to save them.", Helper.CriticalSettingsBackupFileName, Environment.NewLine), App.Metadata.AssemblyTitle, MessageBoxButton.OK, MessageBoxImage.Information); } else { MessageBox.Show(this, String.Format("Backup file {0} does not exist.", Helper.CriticalSettingsBackupFileName), App.Metadata.AssemblyTitle, MessageBoxButton.OK, MessageBoxImage.Error); } }
private void RestoreDefaultSymbolsButton_Click(object sender, RoutedEventArgs e) { SpecialSymbolTextBox.SetCurrentValue(TextBox.TextProperty, Helper.DefaultSpecialSymbols); }