Esempio n. 1
0
        /// <summary>
        /// Save the Application settings
        /// </summary>
        private void SaveSettings()
        {
            Properties.Settings.Default.PocketGpsWorldUsername = usernameTextBox.Text;

            Properties.Settings.Default.PocketGpsWorldPassword   = SecureStrings.EncryptString(SecureStrings.ToSecureString(passwordBox.Password));
            Properties.Settings.Default.IncludeUnverifiedCameras = yesRadioButton.IsChecked.HasValue ? (bool)yesRadioButton.IsChecked : true;
            Properties.Settings.Default.IncludeFixedCameras      = fixedCheckBox.IsChecked.HasValue ? (bool)fixedCheckBox.IsChecked : true;
            Properties.Settings.Default.IncludeMobileCameras     = mobileCheckBox.IsChecked.HasValue ? (bool)mobileCheckBox.IsChecked : true;
            Properties.Settings.Default.IncludeSpecsCameras      = specsCheckBox.IsChecked.HasValue ? (bool)specsCheckBox.IsChecked : true;
            Properties.Settings.Default.IncludeRedlightCameras   = redlightCheckBox.IsChecked.HasValue ? (bool)redlightCheckBox.IsChecked : true;
            Properties.Settings.Default.DatabaseFormat           = databaseFormatComboBox.SelectedItem.ToString();
            Properties.Settings.Default.Save();
        }
Esempio n. 2
0
        /// <summary>
        /// Load the Application settings
        /// </summary>
        private void LoadSettings()
        {
            usernameTextBox.Text = Properties.Settings.Default.PocketGpsWorldUsername;
            if (!string.IsNullOrEmpty(Properties.Settings.Default.PocketGpsWorldPassword))
            {
                passwordBox.Password = SecureStrings.ToInsecureString(SecureStrings.DecryptString(Properties.Settings.Default.PocketGpsWorldPassword));
            }

            yesRadioButton.IsChecked            = Properties.Settings.Default.IncludeUnverifiedCameras;
            fixedCheckBox.IsChecked             = Properties.Settings.Default.IncludeFixedCameras;
            mobileCheckBox.IsChecked            = Properties.Settings.Default.IncludeMobileCameras;
            specsCheckBox.IsChecked             = Properties.Settings.Default.IncludeSpecsCameras;
            redlightCheckBox.IsChecked          = Properties.Settings.Default.IncludeRedlightCameras;
            databaseFormatComboBox.SelectedItem = Properties.Settings.Default.DatabaseFormat;
        }