public MKVMergeDefaultSettingsService(EAC3ToConfiguration eac3toConfiguration, ApplicationSettings applicationSettings, BluRaySummaryInfo bluRaySummaryInfo, IMKVMergeLanguageService languageService, IAudioService audioService) { _eac3toConfiguration = eac3toConfiguration; _applicationSettings = applicationSettings; _bluRaySummaryInfo = bluRaySummaryInfo; _languageService = languageService; _audioService = audioService; }
public void bluraytitleinfodefaultsettingsservice_can_mark_all_chapter_as_selected_as_default_Test() { //given ApplicationSettings applicationSettings = new ApplicationSettings() { BluRayTitleInfoDefaultSettings = new BluRayTitleInfoDefaultSettings() { SelectChapters = true} }; BluRaySummaryInfo bluraySummaryInfo = new BluRaySummaryInfo() { BluRayTitleInfo = new BluRayTitleInfo() { Chapter = new BluRayTitleChapter() { IsSelected = false } } }; BluRayTitleInfoDefaultSettings defaultSettings = new BluRayTitleInfoDefaultSettings() { SelectChapters = true }; IAudioService audioService = new AudioService(); IBluRayTitleInfoDefaultSettingsService service = new BluRayTitleInfoDefaultSettingsService(applicationSettings, bluraySummaryInfo, audioService); //when service.SetChaptersDefaultSettings(); //then bluraySummaryInfo.BluRayTitleInfo.Chapter.IsSelected.Should().BeTrue(); }
public void bluraytitleinfodefaultsettingsservice_can_mark_all_subtitles_as_selected_as_default_Test() { //given ApplicationSettings applicationSettings = new ApplicationSettings() { BluRayTitleInfoDefaultSettings = new BluRayTitleInfoDefaultSettings() { SelectAllSubtitles = true } }; BluRaySummaryInfo bluraySummaryInfo = new BluRaySummaryInfo() { BluRayTitleInfo = new BluRayTitleInfo() { Subtitles = new List<BluRayTitleSubtitle>() { new BluRayTitleSubtitle() { IsSelected = false }, new BluRayTitleSubtitle() { IsSelected = false } } } }; IAudioService audioService = new AudioService(); IBluRayTitleInfoDefaultSettingsService service = new BluRayTitleInfoDefaultSettingsService(applicationSettings, bluraySummaryInfo, audioService); //when service.SetSubtitleDefaultSettings(); //then bluraySummaryInfo.BluRayTitleInfo.Subtitles.Where(s => s.IsSelected == true).Count().Should().Be(2); }
public void Save(ApplicationSettings applicationSettings) { try { _errors.Clear(); _jsonSerializationService.WriteToJsonFile(applicationSettings.SettingsFile, applicationSettings, false); _applicationSettings = applicationSettings; } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() {Description = "There was a problem saving the Application Settings File"}); } }
public ApplicationSettingsService(IJsonSerializationService<ApplicationSettings> jsonSerializationService, IAudioService audioService) { _errors = new ErrorCollection(); _jsonSerializationService = jsonSerializationService; _audioService = audioService; Uri uri = new Uri(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().CodeBase)); _applicationDirectory = uri.LocalPath; _applicationSettings = new ApplicationSettings() { ApplicationDirectory = _applicationDirectory }; if (File.Exists(_applicationSettings.SettingsFile)) { this.LoadSettingsFromConfigFile(); } new SettingsDefaultSeedDataService(_applicationSettings, _audioService).Create(); }
public BluRayTitleInfoDefaultSettingsService(ApplicationSettings applicationSettings, BluRaySummaryInfo bluRaySummaryInfo, IAudioService audioService) { _applicationSettings = applicationSettings; _bluRaySummaryInfo = bluRaySummaryInfo; _audioService = audioService; }
private void LoadSettingsFromConfigFile() { try { _errors.Clear(); _applicationSettings = _jsonSerializationService.ReadFromJsonFile<ApplicationSettings>(_applicationSettings.SettingsFile); } catch (Exception ex) { _log.ErrorFormat(Program.GetLogErrorFormat(), ex.Message, ex.StackTrace, MethodBase.GetCurrentMethod().Name); _errors.Add(new Error() { Description = "There was a problem loading the Application Settings File" }); } }
public SettingsDefaultSeedDataService(ApplicationSettings applicationSettings, IAudioService audioService) { _applicationSettings = applicationSettings; _audioService = audioService; }