aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/ConsoleEx.cs
blob: 74483dcdfb41ac3c88d2d21d9b663665ef09d5ca (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ShiftOS.Engine
{
    /// <summary>
    /// Provides extra eye candy data that can be used by ShiftOS terminals.
    /// </summary>
    public static class ConsoleEx
    {
        /// <summary>
        /// Initializes the <see cref="ConsoleEx"/> class, performing core configuration. 
        /// </summary>
        static ConsoleEx()
        {
            ForegroundColor = ConsoleColor.White;
            BackgroundColor = ConsoleColor.Black;

            Bold = false;
            Italic = false;
            Underline = false;
        }

        /// <summary>
        /// Gets or sets the foreground color of text in the Terminal.
        /// </summary>
        public static ConsoleColor ForegroundColor { get; set; }

        /// <summary>
        /// Gets or sets the background color of text in the Terminal.
        /// </summary>
        public static ConsoleColor BackgroundColor { get; set; }

        /// <summary>
        /// Gets or sets whether text in the Terminal is bold.
        /// </summary>
        public static bool Bold { get; set; }

        /// <summary>
        /// Gets or sets whether text in the Terminal is italic.
        /// </summary>
        public static bool Italic { get; set; }

        /// <summary>
        /// Gets or sets whether text in the Terminal is underlined.
        /// </summary>
        public static bool Underline { get; set; }

        internal static void Flush()
        {
            OnFlush?.Invoke();
        }

        public static Action OnFlush;
    }
}