Пример #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();
     }
 }
Пример #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);
            }
        }
Пример #3
0
 /// <summary>
 /// 'Printlns' the CoolSnippet.
 /// </summary>
 /// <param name="text"></param>
 public static void Println(this CoolSnippet text)
 {
     Out.Println(text);
 }
Пример #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));
 }
Пример #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));
 }
Пример #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);
 }
Пример #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);
 }