Exemplo n.º 1
0
 /// <summary>
 /// 'Printlns' the specified text and colors of the CoolSnippet.
 /// </summary>
 /// <param name="text"></param>
 public static void Println(CoolSnippet text)
 {
     lock (lockP)
     {
         Print(text);
         Println();
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Prints the specified text and colors of the CoolSnippet.
        /// </summary>
        /// <param name="text"></param>
        public static void Print(CoolSnippet text)
        {
            lock (lockP)
            {
                if (text == null)
                {
                    return;
                }

                ConsoleColor previousForeColor = GetForeground();
                SetForeground(text.TextColor.MatchColor(previousForeColor));

                ConsoleColor previousBackColor = GetBackground();
                SetBackground(text.BackColor.MatchColor(previousBackColor));

                Console.Write(text.Text);

                SetForeground(previousForeColor);
                SetBackground(previousBackColor);
            }
        }
Exemplo n.º 3
0
 /// <summary>
 /// 'Printlns' the CoolSnippet.
 /// </summary>
 /// <param name="text"></param>
 public static void Println(this CoolSnippet text)
 {
     Out.Println(text);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Returns a CoolSnippet based on this CoolSnippet with a new backColor.
 /// </summary>
 /// <param name="text">The instance of IColorText</param>
 /// <param name="backColor">New back color</param>
 /// <returns></returns>
 public static CoolSnippet On(this CoolSnippet text, FColor backColor)
 {
     return(new CoolSnippet(text.Text, text.TextColor, backColor));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Returns a CoolSnippet based on this CoolSnippet with a new textColor.
 /// </summary>
 /// <param name="text">The instance of IColorText</param>
 /// <param name="textColor">New text color</param>
 /// <returns></returns>
 public static CoolSnippet I(this CoolSnippet text, FColor textColor)
 {
     return(new CoolSnippet(text.Text, textColor, text.BackColor));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Encapsulates the CoolSnippet value with the specified default colors in this instance of IPrinter then Prints it.
 /// </summary>
 /// <param name="value"></param>
 public void Print(CoolSnippet value)
 {
     // this
     this.Print((CoolText)value);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Encapsulates the CoolSnippet value with the specified default colors in this instance of IPrinter then 'Printlns' it.
 /// </summary>
 /// <param name="value"></param>
 public void Println(CoolSnippet value)
 {
     this.Println((CoolText)value);
 }