using DTS.Common.Settings; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace DTS.Common.Import.Persist { public class SaveGlobalSettings : SaveVariantBase { public SaveGlobalSettings(ImportObject importObject, IPersistCalculator persistCalculator, IImportNotification importNotification, Func isCancelled = null) : base(importObject, persistCalculator, importNotification, isCancelled) { } public override void Save() { foreach (var g in _importObject.GlobalSettings()) { if (IsCancelled()) { return; } SettingsDB.SetGlobalValue(g.Key, g.Value); _persistCalculator.AddDone(); _importNotification.SetProgress(_persistCalculator.ProgressValue); } } } }