コード例 #1
0
 /// <summary>
 /// Экспортировать в другие форматы
 /// </summary>
 private IResultValue <IFileDataSourceServer> ExportFile(IDocumentLibrary documentLibrary, IFilePath filePath, StampDocumentType stampDocumentType) =>
 new ResultError().
 ResultVoidOk(_ => _messagingService.ShowMessage("Экспорт файла")).
 ResultVoidOk(_ => _loggerService.LogByObject(LoggerLevel.Info, LoggerAction.Operation, ReflectionInfo.GetMethodBase(this), filePath.FileNameServer)).
 ResultValueOk(_ => ConvertingFilePath.CreateSavingPath(filePath.FilePathServer,
                                                        _applicationConverting.GetExportFileExtension(filePath.FileExtensionType),
                                                        _fileSystemOperations)).
 ResultValueOkBind(fileExportPath => _applicationConverting.CreateExportFile(documentLibrary, filePath.ChangeServerPath(fileExportPath),
                                                                             stampDocumentType)).
 Void(result => _messagingService.ShowErrors(result.Errors));