private void Process(object request) { ProcessRequest pr = request as ProcessRequest; ProcessResponse response = new ProcessResponse(); response.SourceDoc = pr.SourceDoc; try { string outfile = pr.Handler.ConvertToPDF(pr.SourceDoc, pr.OutDir, true); LogUtils.Debug(String.Format("Generate output file. [source={0}][filename={1}]", pr.SourceDoc, outfile)); response.OutputFile = outfile; } catch (Exception ex) { LogUtils.Error(ex); response.Error = ex; } finally { pr.Callback(response); pr.Event.Set(); } }
private static void ResponseHandler(ProcessResponse response) { if (response.Error != null) { LogUtils.Error(response.Error); throw response.Error; } else { LogUtils.Info(String.Format("Processed Document. [source={0}][output={1}]", response.SourceDoc, response.OutputFile)); } }