/* * @author: jos / George2000 * @copyright: byteEmu, 2012 - 2013 :) © */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace byteEmu.Logging { /// /// Creates a static instance of the Console class for writing data on the main console. This class cannot be inherited. /// public static class Out { /// /// Gets or sets a title displaying in the top of the console. /// public static string Title { get { return Console.Title; } set { Console.Title = value; } } /// /// Writes some data without new line to the console. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void Write(string TagText, string Text) { if (TagText == "") { Console.Write(Text); } else { Console.Write("[" + TagText + "] "); Console.Write(Text); } } /// /// Writes some data with new line to the console. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void WriteLine(string TagText, string Text) { if (TagText == "") { Console.WriteLine(Text); } else { Console.Write("[" + TagText + "] "); Console.WriteLine(Text); } } /// /// Writes some data without new line to the console with a color for tags. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void Write(string TagText, string Text, ConsoleColor TagTextColor) { Console.ForegroundColor = TagTextColor; Console.Write("[" + TagText + "] "); Console.Write(Text); Console.ResetColor(); } /// /// Writes some data without new line to the console with a color for tags and text. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void Write(string TagText, string Text, ConsoleColor TagTextColor, ConsoleColor TextColor) { Console.ForegroundColor = TagTextColor; Console.Write("[" + TagText + "] "); Console.ForegroundColor = TextColor; Console.Write(Text); Console.ResetColor(); } /// /// Writes some data with new line to the console with a color for tags. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void WriteLine(string TagText, string Text, ConsoleColor TagTextColor) { Console.ForegroundColor = TagTextColor; Console.Write("[" + TagText + "] "); Console.WriteLine(Text); Console.ResetColor(); } /// /// Writes some data with new line to the console with a color for tags and text. /// /// The text, in beginning in [ and ]. Use "" if you don't want to use tags. /// The text to display. public static void WriteLine(string TagText, string Text, ConsoleColor TagTextColor, ConsoleColor TextColor) { Console.ForegroundColor = TagTextColor; Console.Write("[" + TagText + "] "); Console.ForegroundColor = TextColor; Console.WriteLine(Text); Console.ResetColor(); } } }