コード例 #1
0
 /// <summary>
 /// Печать
 /// </summary>
 private IResultValue <IFileDataSourceServer> CreatePrintingService(IDocumentLibrary documentLibrary, IStamp stamp, IFilePath filePath,
                                                                    ConvertingModeType convertingModeType, ColorPrintType colorPrintType,
                                                                    IResultValue <IPrinterInformation> printerInformation) =>
 printerInformation.
 ResultVoidOk(printer => _messagingService.ShowMessage($"Установка принтера {printer.Name}")).
 ResultVoidOk(printer => SetDefaultPrinter(printer.Name)).
 ResultVoidOk(printer => _messagingService.ShowMessage($"Печать файла {filePath.FileNameClient}")).
 ResultValueOkBind(_ => PrintCommand(documentLibrary, stamp, filePath.FilePathServer, convertingModeType, colorPrintType,
                                     printerInformation.Value.PrefixSearchPaperSize)).
 ResultVoidOk(_ => _loggerService.LogByObject(LoggerLevel.Debug, LoggerAction.Operation, ReflectionInfo.GetMethodBase(this), filePath.FilePathServer)).
 ResultValueOk(_ => new FileDataSourceServer(filePath.FilePathServer, filePath.FilePathClient, convertingModeType,
                                             stamp.PaperSize, printerInformation.Value.Name));