public void OnStdOut(string line) { if (line == null) { throw new ArgumentNullException(nameof(line)); } _stdOut.WriteLine(new Text(line)); }
private void WriteLine(Text[] message, bool showPrefix, Color color = Color.Default) { if (message.Length <= 0) { return; } for (var i = 0; i < message.Length; i++) { var item = message[i]; if (color != Color.Default && item.Color == Color.Default) { message[i] = new Text(item.Value, color); } } if (showPrefix) { var line = new List <Text> { _prefix }; foreach (var text in message) { if (text.Value == Text.NewLine.Value) { _stdOut.WriteLine(line.ToArray()); line.Clear(); line.Add(_emptyPrefix); } else { line.Add(text); } } if (line.Count > 0) { _stdOut.WriteLine(line.ToArray()); } } else { _stdOut.WriteLine(message); } }
public void OnStdOut(string line) { if (line == null) { throw new ArgumentNullException(nameof(line)); } if (!_messageProcessor.ProcessServiceMessages(line, this)) { _stdOut.WriteLine(new Text(line)); } }