示例#1
0
        public void DisplayTerminalOutput(byte terminalId, byte[] output)
        {
            if (_applicationSettings.EnableLogging && Directory.Exists(_applicationSettings.LogDirectoryPath))
            {
                var logOutput = output;
                if (_applicationSettings.PrintableOutputOnly)
                {
                    string strOutput = System.Text.Encoding.UTF8.GetString(logOutput);
                    strOutput = EscapeSequencePattern.Replace(strOutput, "");
                    logOutput = Encoding.UTF8.GetBytes(strOutput);
                }

                try
                {
                    using (var logFileStream = System.IO.File.Open(GetLogFilePath(terminalId), System.IO.FileMode.Append))
                    {
                        logFileStream.Write(logOutput, 0, logOutput.Length);
                    }
                }
                catch (Exception) { }
            }

            DisplayOutputRequested?.Invoke(this, new TerminalOutput
            {
                TerminalId = terminalId,
                Data       = output
            });
        }
 public void DisplayTerminalOutput(int terminalId, byte[] output)
 {
     DisplayOutputRequested?.Invoke(this, new DisplayTerminalOutputRequest
     {
         TerminalId = terminalId,
         Output     = output
     });
 }
 public void DisplayTerminalOutput(byte terminalId, byte[] output)
 {
     DisplayOutputRequested?.Invoke(this, new TerminalOutput
     {
         TerminalId = terminalId,
         Data       = output
     });
 }