public static void WriteLine <T>(System.ConsoleColor fgCol, System.ConsoleColor bgCol, T s) { System.Console.ForegroundColor = fgCol; System.Console.BackgroundColor = bgCol; System.Console.WriteLine(s); System.Console.ResetColor(); }
public static void WriteAt <T>(int x, int y, System.ConsoleColor fgCol, T s) { System.Console.SetCursorPosition(x, y); System.Console.ForegroundColor = fgCol; System.Console.Write(s); System.Console.ResetColor(); }
public void Say(bool delay) { System.ConsoleColor temp = System.Console.ForegroundColor; System.Console.ForegroundColor = _color; _messange.Say(delay); System.Console.ForegroundColor = temp; }
/// <summary> /// Change the forgroud color of the specified widget for 200 ms /// </summary> /// <param name="color">the color to flash to</param> public void Flash(System.ConsoleColor color) { flashColor = forColor; forColor = color; eventDelay.Enabled = true; eventDelay.Elapsed += Delayed_Flash; eventDelay.AutoReset = false; }
public static void Render(char value, int x, int y, System.ConsoleColor color) { System.Console.CursorVisible = false; System.Console.SetCursorPosition(x, y); System.Console.ForegroundColor = color; System.Console.Write(value); System.Console.ResetColor(); }
private static void WriteColor(string message, System.ConsoleColor color) { var cc = System.Console.ForegroundColor; System.Console.ForegroundColor = color; System.Console.WriteLine(message); System.Console.ForegroundColor = cc; }
public static void WriteLine(string message, System.ConsoleColor color) { var fcolor = System.Console.ForegroundColor; System.Console.ForegroundColor = color; System.Console.WriteLine(message); System.Console.ForegroundColor = fcolor; System.Console.WriteLine("Check log for more details"); }
public static void WriteBlueLine(string value) { System.ConsoleColor currentColor = CLRConsole.ForegroundColor; CLRConsole.ForegroundColor = System.ConsoleColor.Blue; CLRConsole.WriteLine(value); CLRConsole.ForegroundColor = currentColor; }
static public void Log(string msg, System.ConsoleColor?color = null) { System.ConsoleColor _defaultColor = System.Console.ForegroundColor; if (color != null) { System.Console.ForegroundColor = (System.ConsoleColor)color; } System.Console.Write(msg); System.Console.ForegroundColor = _defaultColor; }
public bool PutStringCenteredColor(string str, int y, System.ConsoleColor col) { if (str.Length > this.width - 1) { return(false); } int x = this.width / 2 - str.Length / 2; return(PutStringColor(str, x, y, col)); }
public static Color FromColor(System.ConsoleColor c) { int cInt = (int)c; int brightnessCoefficient = ((cInt & 8) > 0) ? 2 : 1; int r = ((cInt & 4) > 0) ? 64 * brightnessCoefficient : 0; int g = ((cInt & 2) > 0) ? 64 * brightnessCoefficient : 0; int b = ((cInt & 1) > 0) ? 64 * brightnessCoefficient : 0; return(new Color(r, g, b)); }
public bool CheckForKey(System.ConsoleColor color) { foreach (var key in playerInventory) { if (color == key.Color) { return(true); } } return(false); }
public bool PutCharColor(char c, int x, int y, System.ConsoleColor col) { if (x >= this.width || x < 0 || y >= this.height || y < 0) { return(false); } this.buffer[y, x] = c; this.colorMask[y, x] = col; return(true); }
public void ClearMask(System.ConsoleColor color) { for (int j = 0; j < this.height; j++) { for (int i = 0; i < this.width; i++) { this.colorMask[j, i] = color; } } return; }
private static Key[] CreateTrials() { const int count = 101; var result = new Key[count * 2]; for (int i = 0; i != count; ++i) { int value = 83 * i % count; result[2 * i] = (Key)value; result[2 * i + 1] = (Key) ~value; } return(result); }
public static void Render(char[,] value, int xLenth, int yLenth, System.ConsoleColor color) { System.Console.CursorVisible = false; System.Console.SetCursorPosition(0, 0); for (int i = 0; i < xLenth; i++) { for (int j = 0; j < yLenth; j++) { System.Console.ForegroundColor = color; System.Console.Write(value[i, j]); } System.Console.WriteLine(); } System.Console.ResetColor(); }
public static void Send(LogLevel Level, System.ConsoleColor Color, string Id, string Svc, string Msg) { System.Console.ForegroundColor = System.ConsoleColor.Gray; System.Console.Write(System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString()); System.Console.ForegroundColor = Color; System.Console.Write(" " + Id + " "); System.Console.ForegroundColor = System.ConsoleColor.White; System.Console.Write(Svc + ": "); System.Console.ForegroundColor = Color; System.Console.WriteLine(Msg); System.Console.ForegroundColor = System.ConsoleColor.Gray; string FileLog = System.DateTime.Now.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString(); FileLog += " " + Id + " " + Svc + ": " + Msg; }
public bool PutStringColor(string str, int x, int y, System.ConsoleColor col) { if (y < 0 || y >= this.height || x < 0 || x + str.Length - 1 >= this.width) { return(false); } foreach (char c in str) { this.buffer[y, x] = c; this.colorMask[y, x] = col; x++; } return(true); }
private static void Print(System.ConsoleColor color, LogType type, string logs) { if (Enabled) { //System.Diagnostics.StackTrace st = new System.Diagnostics.StackTrace(); //System.Diagnostics.StackFrame[] sfs = st.GetFrames(); //string[] methodName = new string[sfs.Length]; //for (int i = 0; i < sfs.Length; i++) //{ // methodName[i] = sfs[i].GetFileName() + sfs[i].GetType().Name + sfs[i].GetFileLineNumber() + sfs[i].GetMethod().Name; //} //LogList.Add(new Log(1, logs, string.Join("\n", methodName), type)); System.Console.ForegroundColor = color; System.Console.WriteLine(System.DateTime.Now.TimeOfDay + " >>> " + logs); System.Console.ForegroundColor = System.ConsoleColor.White; } }
private static void Log(object data, System.ConsoleColor foregroundColor) { if (System.Environment.UserInteractive) { lock (App.Lock) try { var oldFgColor = System.Console.ForegroundColor; System.Console.ForegroundColor = System.ConsoleColor.Cyan; System.Console.Write("{0:HH:hh:ss} ", System.DateTime.Now); System.Console.ForegroundColor = foregroundColor; System.Console.WriteLine(data); System.Console.ForegroundColor = oldFgColor; } catch (System.Exception ex) { System.Diagnostics.Debug.WriteLine(ex); } } }
private static void internalWriteLine(string str, List <System.ConsoleColor> charColors) { // number of returns to print int returnCount = str.Count(ch => ch == '\n'); // create extra returns at bottom of screen and moves cursor to starting place System.Console.ResetColor(); System.ConsoleColor currentColor = System.Console.ForegroundColor; for (int i = 0; i < str.Length; i++) { if (currentColor != charColors[i]) { currentColor = charColors[i]; System.Console.ForegroundColor = charColors[i]; } System.Console.Write(str[i]); } System.Console.ResetColor(); System.Console.Write("\n"); }
public Tetromino(bool block = false, int color = 0) { B = block; switch (color) { case 1: Color = Cyan; break; case 2: Color = Yellow; break; case 3: Color = DarkMagenta; break; case 4: Color = Red; break; case 5: Color = DarkGreen; break; case 6: Color = DarkCyan; break; case 7: Color = Blue; break; default: Color = DarkGray; break; } }
public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight, int targetLeft, int targetTop, char sourceChar, System.ConsoleColor sourceForeColor, System.ConsoleColor sourceBackColor) { }
/// <summary> /// Sends a raw log message to the game console. /// </summary> /// <param name="message">The message to be sent.</param> /// <param name="color">The <see cref="System.ConsoleColor"/> of the message.</param> public static void SendRaw(string message, System.ConsoleColor color) => ServerConsole.AddLog(message, color);
/// <summary> /// Sends a log message to the game console. /// </summary> /// <param name="message">The message to be sent.</param> /// <param name="level">The message level of importance.</param> /// <param name="color">The message color.</param> public static void Send(string message, LogLevel level, System.ConsoleColor color = System.ConsoleColor.Gray) { SendRaw($"[{level.ToString().ToUpper()}] {message}", color); }
/// <summary> /// Sends a raw log message to the game console. /// </summary> /// <param name="message">The message to be sent.</param> /// <param name="color">The <see cref="System.ConsoleColor"/> of the message.</param> public static void SendRaw(object message, System.ConsoleColor color) => ServerConsole.AddLog(message.ToString(), color);
private static void internalWriteLine(string str, System.ConsoleColor foregroundColor) { List <System.ConsoleColor> charColors = Enumerable.Repeat(foregroundColor, str.Length).ToList(); internalWriteLine(str, charColors); }
public HtmlOutputWriter() { this.m_backupForeground = System.Console.ForegroundColor; this.m_backupBackground = System.Console.BackgroundColor; }
public ConsoleForeground(System.ConsoleColor color) { this.oldColor = System.Console.ForegroundColor; System.Console.ForegroundColor = color; }
public static void ShowText(string HelpLine, System.ConsoleColor Foreground, System.ConsoleColor Background, string LogPathFileName) { ShowTextOnConsole(HelpLine, Foreground, Background, true, LogPathFileName); }
public ForgeColorDecorateIMessange(IMessange messanger, System.ConsoleColor color) { _messange = messanger; _color = color; }