public void Synchronization() { _settingsModel = CreateOrGet(); if (_settingsModel != null) { _initialSettings = _parserSetting.Parse(_settingsModel); IList <ISetting> emptySettings = emptySettingsProvider.GetSettings().ToList(); emptySettings.Except(_initialSettings, new SettingEqualityComparer()).DoForEach(_initialSettings.Add); _actualSettings = _initialSettings.Select(x => x.MakeCopy()).ToList(); } else { _initialSettings = emptySettingsProvider.GetSettings().ToList(); _actualSettings = _initialSettings.Select(x => x.MakeCopy()).ToList(); _settingsModel = new SettingsModel { Application = _appName, SettingsInJson = _parserSetting.ToJson(_actualSettings) }; } }
public ParserSetting( IEmptySettingsProvider emptySettingsProvider, [Import("LOCAL")] IEmptySettingsProvider localeEmptySettingsProvider) { _settings = emptySettingsProvider.GetSettings().Concat(localeEmptySettingsProvider.GetSettings()); }