/// <summary> /// Creates the text file for the job separator and submits it to the print queue /// </summary> /// <param name="executionData"></param> /// <param name="printQueue"></param> protected virtual void PrintJobSeparator(PluginExecutionData executionData, PrintQueue printQueue) { StringBuilder strFileContent = PrintTag(printQueue, executionData); string tagfileName = Path.Combine(Path.GetTempPath(), executionData.ActivityExecutionId + ".txt"); File.WriteAllText(tagfileName, strFileContent.ToString(), Encoding.ASCII); FilePrinter printer = FilePrinterFactory.Create(tagfileName); printer.Print(printQueue); File.Delete(tagfileName); }
private void PrintTag(PrintQueue printQueue, PluginExecutionData executionData) { StringBuilder strFileContent = new StringBuilder(); strFileContent.AppendLine(); strFileContent.AppendLine(); strFileContent.AppendLine($"UserName: {_userName}"); strFileContent.AppendLine($"Session ID: {_sessionId}"); strFileContent.AppendLine($"Actvity ID: {executionData.ActivityExecutionId}"); strFileContent.AppendLine($"Date: {DateTime.Now.ToShortDateString()}"); strFileContent.AppendLine($"Time: {DateTime.Now.ToShortTimeString()}"); string tagfileName = Path.Combine(Path.GetTempPath(), $"{executionData.ActivityExecutionId}.txt"); File.WriteAllText(tagfileName, strFileContent.ToString(), Encoding.ASCII); FilePrinter printer = FilePrinterFactory.Create(tagfileName); printer.Print(printQueue); File.Delete(tagfileName); }
private static void PrintTag(PrintQueue printQueue, PluginExecutionData executionData) { StringBuilder strFileContent = new StringBuilder(); strFileContent.AppendLine(); strFileContent.AppendLine(); strFileContent.AppendLine(string.Format("UserName: {0}", Environment.UserName)); strFileContent.AppendLine(string.Format("Session ID: {0}", executionData.SessionId)); strFileContent.AppendLine(string.Format("Activity ID:{0}", executionData.ActivityExecutionId)); strFileContent.AppendLine(string.Format("Date: {0}", DateTime.Now.ToShortDateString())); strFileContent.AppendLine(string.Format("Time: {0}", DateTime.Now.ToShortTimeString())); string tagfileName = Path.Combine(Path.GetTempPath(), executionData.ActivityExecutionId + ".txt"); File.WriteAllText(tagfileName, strFileContent.ToString(), Encoding.ASCII); FilePrinter printer = FilePrinterFactory.Create(tagfileName); printer.Print(printQueue); File.Delete(tagfileName); }