private void btnSave_Click(object sender, RoutedEventArgs e) { try { foreach (GLSettingViewModel item in ViewModels) { item.Save(_settings); } File.WriteAllLines(_file, _settings.GetOutput()); Sys.Message(new WMessage("Game Driver settings saved!")); this.Close(); } catch (UnauthorizedAccessException) { MessageDialogWindow.Show("Could not write to 7H_GameDriver.cfg file. Check that it is not set to read only, and that FF7 is installed in a folder you have full write access to.", "Save Error", MessageBoxButton.OK, MessageBoxImage.Warning); } catch (Exception ex) { Logger.Error(ex); SetStatusMessage("Unknown error while saving. error has been logged."); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { foreach (GLSettingViewModel item in ViewModels) { item.Save(_settings); } File.WriteAllLines(_file, _settings.GetOutput()); Sys.Message(new WMessage(ResourceHelper.Get(StringKey.GameDriverSettingsSaved))); this.Close(); } catch (UnauthorizedAccessException) { MessageDialogWindow.Show(ResourceHelper.Get(StringKey.CouldNotWriteTo7HGameDriverCfg), ResourceHelper.Get(StringKey.SaveError), MessageBoxButton.OK, MessageBoxImage.Warning); } catch (Exception ex) { Logger.Error(ex); SetStatusMessage(ResourceHelper.Get(StringKey.UnknownErrorWhileSaving)); } }