/// <summary> /// Экспортировать в другие форматы и добавить в список обработанных файлов /// </summary> private IResultCollection <IFileDataSourceServer> ExportFileToSaveResult(IResultCollection <IFileDataSourceServer> saveResult, IDocumentLibrary documentLibrary, IFilePath filePath, IConvertingSettings convertingSettings) => documentLibrary.GetStampContainer(convertingSettings.ToApplication()). WhereContinue(stampContainer => ConvertingModeChoice.IsDwgConvertingNeed(convertingSettings.ConvertingModeTypes) && (stampContainer.StampDocumentType == StampDocumentType.Specification || stampContainer.StampDocumentType == StampDocumentType.Drawing), okFunc: stampContainer => saveResult.ConcatResultValue(ExportFile(documentLibrary, filePath, stampContainer.StampDocumentType)), badFunc: _ => saveResult);
/// <summary> /// Обработать штампы и начать печать /// </summary> private IResultCollection <IFileDataSourceServer> StampContainerProcessing(IStampContainer stampContainer, IDocumentLibrary documentLibrary, FilePathCollection filePathCollection, IConvertingSettings convertingSettings, ColorPrintType colorPrintType) => stampContainer. Void(_ => _messagingService.ShowMessage("Подключение дополнительных элементов...")). Void(_ => documentLibrary.AttachAdditional()). Void(_ => _messagingService.ShowMessage("Форматирование полей...")). CompressFieldsRanges(). Void(_ => _loggerService.LogByObject(LoggerLevel.Debug, LoggerAction.Operation, ReflectionInfo.GetMethodBase(this), nameof(stampContainer.CompressFieldsRanges))). Map(_ => GetSavedFileDataSource(documentLibrary, filePathCollection.FilePathMain)). WhereContinue(_ => ConvertingModeChoice.IsPdfConvertingNeed(convertingSettings.ConvertingModeTypes), filesDataSource => StampContainerCreatePdf(stampContainer, documentLibrary, filePathCollection.FilePathPdf, convertingSettings, ConvertingModeType.Pdf, colorPrintType). Map(filesDataSource.ConcatResult), filesDataSource => filesDataSource). WhereContinue(_ => ConvertingModeChoice.IsPrintConvertingNeed(convertingSettings.ConvertingModeTypes), filesDataSource => StampContainerPrint(stampContainer, documentLibrary, filePathCollection.FilePathPrint, convertingSettings, ConvertingModeType.Print, colorPrintType). Map(filesDataSource.ConcatResult), filesDataSource => filesDataSource). Void(_ => documentLibrary.DetachAdditional());