Exemple #1
0
        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;
        }
Exemple #2
0
        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
                });
            });
        }
Exemple #3
0
 private void AppendLogText(ILogText text)
 {
     textBlock.Inlines.Add(new Run($"{text.Text}{Environment.NewLine}"));
 }