Esempio n. 1
0
 /// <summary>
 /// Restores a set of console settings to the global console
 /// </summary>
 /// <param name="consoleSettings">The console settings to be restored</param>
 public static void RestoreSettings(ConsoleInfo consoleSettings)
 {
     Console.BackgroundColor = consoleSettings.BackgroundColor;
     Console.CursorSize      = consoleSettings.CursorSize;
     Console.CursorVisible   = consoleSettings.CursorVisible;
     Console.ForegroundColor = consoleSettings.ForegroundColor;
 }
Esempio n. 2
0
        /// <summary>
        /// Extracts the current console settings and saves them in a ConsoleInfo object
        /// </summary>
        /// <returns>The current console settings</returns>
        public static ConsoleInfo CurrentInfo()
        {
            ConsoleInfo currentSettings = new ConsoleInfo()
            {
                BackgroundColor = Console.BackgroundColor,
                CursorSize      = Console.CursorSize,
                CursorVisible   = Console.CursorVisible,
                ForegroundColor = Console.ForegroundColor
            };

            return(currentSettings);
        }