예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
            }
        }
예제 #4
0
 private void RestoreDefaultSymbolsButton_Click(object sender, RoutedEventArgs e)
 {
     SpecialSymbolTextBox.SetCurrentValue(TextBox.TextProperty, Helper.DefaultSpecialSymbols);
 }