Exemple #1
0
 private void cmdLoadSettings_Click(object sender, RoutedEventArgs e)
 {
     OpenFileDialog dlg = new OpenFileDialog();
     dlg.Filter = "Settings (*.settings)|*.settings";
     bool? result = dlg.ShowDialog();
     if (result == true)
     {
         SettingsManager mgr = new SettingsManager();
         var settings = mgr.LoadSettings(dlg.FileName);
         LoadSettings(settings);
     }
 }
Exemple #2
0
 private void cmdSaveSettings_Click(object sender, RoutedEventArgs e)
 {
     SaveFileDialog dlg = new SaveFileDialog();
     dlg.Filter = "Settings (*.settings)|*.settings";
     bool? result = dlg.ShowDialog();
     if (result == true)
     {
         SettingsManager mgr = new SettingsManager();
         var settings = SaveSettings();
         mgr.SaveSettings(dlg.FileName, settings);
     }
 }