Esempio n. 1
0
 private void SetupSave(object sender, SettingsSaveEventArgs e)
 {
     settings = e.Settings;
     loadSettingsValues();
     pnlSetup.Visibility = System.Windows.Visibility.Collapsed;
 }
Esempio n. 2
0
        private void btnResetAnchor_Click(object sender, RoutedEventArgs e)
        {
            MessageBoxResult result = MessageBox.Show("Are you sure you want to reset Anchor? There is no return.", "Reset Anchor App", MessageBoxButton.YesNo, MessageBoxImage.Question);
            if (result == MessageBoxResult.Yes)
            {
                entries.Clear();
                hostEditor.clear();
                hostEditor.update();
                writer.write(driver.ServerRootPath, new List<Entry>());
                this.restartApache();
                settings = null;

                string hostFile = Path.Combine(Environment.GetEnvironmentVariable("SystemRoot"), "System32\\drivers\\etc\\hosts");

                // reset hosts file back to pre-Anchor usage.
                if (File.Exists(hostFile + ".orig"))
                {
                    File.Delete(hostFile);
                    File.Copy(hostFile + ".orig", hostFile);
                }

                lblNoSites.Visibility = System.Windows.Visibility.Visible;
                lstSites.Visibility = System.Windows.Visibility.Collapsed;
                closeSettingsPanel();
                pnlSetup.Visibility = System.Windows.Visibility.Visible;
            }
        }
Esempio n. 3
0
 private void loadSettings()
 {
     try
     {
         settings = DataFile.Read<Settings>("settings.bin");
         if (settings == null)
         {
             throw new ArgumentNullException();
         }
         loadSettingsValues();
     }
     catch (Exception)
     {
         pnlSetup.Visibility = System.Windows.Visibility.Visible;
         tgbEnableDisable.IsChecked = false;
     }
 }
Esempio n. 4
0
 public void Load(Settings settings)
 {
     txtWampServerPath.Text = settings.WampServerPath;
 }