Beispiel #1
0
    //constructors
        /// <summary>
        /// Creates a new console dot object with the specified parameters
        /// </summary>
        public ConsoleDots(int interval, ConsoleColor? fore = null, ConsoleColor? back = null, char dot = '.', CT start = null, CT finish = null, bool autostart = true) {
            this.dot = dot;

            dotColor = new ConsoleColors(fore, back);

            this.start  = start;
            this.finish = finish;


            timer = new Timer(interval);
            timer.Elapsed += Dot;

            if (autostart) {
                Start();
            }
        }
Beispiel #2
0
 //constructor
     /// <summary>
     /// Constructor to just assigns values.
     /// </summary>
     public CT(string text, ConsoleColor? fore = null, ConsoleColor? back = null) {
         _text = text;
         _colors = new ConsoleColors(fore, back);
     }
Beispiel #3
0
 /// <summary>
 /// Sets the console colors
 /// </summary>
 public static void Color(ConsoleColors colors) {
     if (colors != null) {
         Color(colors.fore, colors.back);
     }
 }
Beispiel #4
0
 /// <summary>
 /// reads a line of text from the console with the specified text colors
 /// </summary>
 public static string ReadLine(ConsoleColors colors = null) {
     using (new ColorConsole(colors)) {
         return Console.ReadLine();
     }
 }
Beispiel #5
0
 /// <summary>
 /// changes the console colors and then writes text to the console
 /// </summary>
 public static void Write(ConsoleColors colors, string str, params object[] objects) {
     Color(colors);
     Console.Write(str, objects);
 }
Beispiel #6
0
        /// <summary>
        /// save current console color and set it to the provided values if they are provided
        /// </summary>
        public ColorConsole(ConsoleColors colors = null)  {
            old = ConsoleColors.current;

            Konsole.Color(colors);
        }