private void PrintText(ILogText text) { var isHeader = text.Text.StartsWith("/* "); var isComment = text.Text.StartsWith("# "); if (isHeader || isComment) { Console.ForegroundColor = ConsoleColor.DarkGreen; } Console.WriteLine(text.Text); Console.ForegroundColor = ForegroundColor; }
private void AppendLogText(ILogText logText) { textBlock.Dispatcher.Invoke(() => { var isHeader = logText.Text.StartsWith("/* "); var isComment = logText.Text.StartsWith("# "); var brush = isHeader || isComment ? Brushes.LimeGreen : textBlock.Foreground; textBlock.Inlines.Add(new Run($"{logText.Text}{Environment.NewLine}") { FontWeight = isHeader ? FontWeights.Bold : FontWeights.Normal, Foreground = brush }); }); }
private void AppendLogText(ILogText text) { textBlock.Inlines.Add(new Run($"{text.Text}{Environment.NewLine}")); }