public virtual void HandlePreviousStepResult(object sender, FileStoragePipelineEventArgs args) { if (args.BatchFilePaths == null) { throw new ArgumentNullException(nameof(args.BatchFilePaths)); } if (!args.BatchFilePaths.Any()) { throw new ArgumentException(nameof(args.BatchFilePaths), "The pathed batch contains no files."); } ServiceStateInfo.Instance.UpdateState(ServiceState.IsHandlingBatch); _safeExecuteManager.ExecuteWithExceptionLogging(() => { foreach (var file in args.BatchFilePaths) { _pdfGenerator.AddImageToDocument(file); } var outputFilePath = GetOutputPath(args.BatchFilePaths.First()); _pdfGenerator.SavePdf(outputFilePath); args.FilePath = outputFilePath; OnStepExecuted(this, args); }); }
public void HandlePreviousStepResult(object sender, FileStoragePipelineEventArgs args) { ServiceStateInfo.Instance.UpdateState(ServiceState.IsProvidingBatch); _safeExecuteManager.ExecuteWithExceptionLogging(() => { if (IsFileFromNewPatch(args.FilePath)) { ProvideNewBatch(); } }); _documentParts.Add(args.FilePath); }
public void HandlePreviousStepResult(object sender, FileStoragePipelineEventArgs args) { ServiceStateInfo.Instance.UpdateState(ServiceState.IsPublishungBatch); _safeExecuteManager.ExecuteWithExceptionLogging(() => { if (_fileSystemHelper.FileAccessMonitor.IsFileIsReadyForAccess(args.FilePath)) { foreach (var fileMessage in _filePatchMessageFactory.GetFilePatchMessages(args.FilePath)) { _publisher.Publish(fileMessage); } _fileSystemHelper.FileHelper.DeleteFile(args.FilePath); } OnStepExecuted(this, args); }); }
public void HandlePreviousStepResult(object sender, FileStoragePipelineEventArgs args) { if (args.BatchFilePaths == null) { throw new ArgumentNullException(nameof(args.BatchFilePaths)); } if (!args.BatchFilePaths.Any()) { throw new ArgumentException(nameof(args.BatchFilePaths), "The pathed batch contains no files."); } ServiceStateInfo.Instance.UpdateState(ServiceState.IsCleaningBatchFiles); _safeExecuteManager.ExecuteWithExceptionLogging(() => { foreach (var file in args.BatchFilePaths) { _fileSystemHelper.FileHelper.DeleteFile(file); } }); }
private void OnStepExecuted(object sender, FileStoragePipelineEventArgs e) { StepExecuted?.Invoke(this, e); }