Ejemplo n.º 1
0
        static void WritePlayerStatsError(object sender, PopulatingStatsErrorEventArgs e)
        {
            var old_color = Console.ForegroundColor;

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine($"{e.TimeError}: {e.Message}");
            Console.ForegroundColor = old_color;
        }
Ejemplo n.º 2
0
        void WritePlayerStatsError(object sender, PopulatingStatsErrorEventArgs e)
        {
            int length  = outputBox.TextLength;             // at end of text
            var message = $"{ e.TimeError}: { e.Message}" + Environment.NewLine;

            outputBox.AppendText(message);
            outputBox.SelectionStart  = length;
            outputBox.SelectionLength = message.Length;
            outputBox.SelectionColor  = Color.Red;
            outputBox.DeselectAll();
        }