protected void LoadPendingImportJobs() { lock (_syncObj) { ISettingsManager settingsManager = ServiceRegistration.Get <ISettingsManager>(); ImporterWorkerSettings settings = settingsManager.Load <ImporterWorkerSettings>(); _importJobs.Clear(); CollectionUtils.AddAll(_importJobs, settings.PendingImportJobs); _importJobsReadyAvailableEvent.Set(); } }
protected void PersistPendingImportJobs() { lock (_syncObj) { ISettingsManager settingsManager = ServiceRegistration.Get <ISettingsManager>(); ImporterWorkerSettings settings = settingsManager.Load <ImporterWorkerSettings>(); settings.PendingImportJobs = new List <ImportJob>(_importJobs); settingsManager.Save(settings); foreach (ImportJob job in _importJobs) { job.Dispose(); } _importJobs.Clear(); } }