/// <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(); } }
/// <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); } }
/// <summary> /// 'Printlns' the CoolSnippet. /// </summary> /// <param name="text"></param> public static void Println(this CoolSnippet text) { Out.Println(text); }
/// <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)); }
/// <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)); }
/// <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); }
/// <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); }