public void SaveSettingsInRegistry(PdfCreatorSettings settings) { CheckGuids(settings); var regStorage = BuildStorage(); _logger.Debug("Saving settings"); settings.SaveData(regStorage, ""); LogProfiles(settings); }
public void Settings_Save_ExpectsNothing() { var settings = new PdfCreatorSettings(Substitute.For <IStorage>()); settings.ConversionProfiles.Add(new ConversionProfile { Guid = "p1" }); settings.ConversionProfiles.Add(new ConversionProfile { Guid = "p2" }); settings.SaveData(""); }
public void Settings_Save_ExpectsNothing() { var settings = new PdfCreatorSettings(); settings.ConversionProfiles.Add(new ConversionProfile { Guid = "p1" }); settings.ConversionProfiles.Add(new ConversionProfile { Guid = "p2" }); var storage = new DataStorageFactory().BuildIniStorage(""); settings.SaveData(storage); }
public void SaveSettings(PdfCreatorSettings settings) { var path = _appDataProvider.LocalAppDataFolder; var backupFile = DateTime.Now.ToString("yyyyMMdd") + "_backup.ini"; backupFile = PathSafe.Combine(path, backupFile); _directory.CreateDirectory(path); var storage = _storageFactory.BuildIniStorage(backupFile); settings.SaveData(storage); }
/// <summary> /// Saves the settings. An Exception will be thrown if the settings have not been previously loaded /// </summary> public static void SaveSettings() { if (_settings == null) { throw new NullReferenceException("The settings have not been loaded before"); } // Get the NextUpdate value from the update manager _settings.ApplicationProperties.NextUpdate = UpdateAssistant.NextUpdate; CheckGuids(); _logger.Debug("Saving settings"); _settings.SaveData(""); if (_logger.IsTraceEnabled) { _logger.Trace("Profiles:"); foreach (var conversionProfile in _settings.ConversionProfiles) { _logger.Trace(conversionProfile.Name); } } }