private void ExportThread() { ServiceProvider.Instance.OnMessage(Messages.SetBusy, "Exporting images ..."); try { foreach (var exportItem in Profile.ExportItems) { IExportPlugin plugin = GetPlugin(exportItem.Id); if (plugin == null) { continue; } for (int i = 0; i < Profile.Files.Count; i++) { ServiceProvider.Instance.OnMessage(Messages.SetBusy, $"Loading images ... {i + 1}/{Profile.Files.Count}"); var fileItem = Profile.Files[i]; fileItem.ImageNumber = i + 1; plugin.Export(exportItem, fileItem, Profile); } } } catch (Exception e) { Log.Debug("Export error", e); } ServiceProvider.Instance.OnMessage(Messages.ClearBusy); Profile.SessionCounter++; Profile.CleanUp(); Profile.Save(); ServiceProvider.Instance.OnMessage(Messages.ChangeLayout, null, ViewEnum.Start); }
/// <summary> /// <inheritdoc cref="Save()"/> /// </summary> /// <param name="exporter"></param> /// <param name="fileName"></param> public void Save(IExportPlugin exporter, string fileName) { if (exporter == null) { throw new ArgumentNullException(nameof(exporter)); } if (string.IsNullOrWhiteSpace(fileName)) { throw new ArgumentNullException(nameof(fileName)); } exporter.Export(ObjectFX, fileName); if (Exporter == null) { Exporter = exporter; } FileName = fileName; OnStatusChanged(FileStatus.Saved); }