public GetConsoleColor ( Color color ) : ConsoleColor | ||
color | Color | The System.Drawing.Color whose ConsoleColor alias should be retrieved. |
return | ConsoleColor |
private static void MapToScreen(IEnumerable<KeyValuePair<string, Color>> styleMap, string trailer) { #if !NET40 Queue.Enqueue(() => Task.Factory.StartNew(() => { #endif var oldSystemColor = System.Console.ForegroundColor; int writeCount = 1; foreach (KeyValuePair<string, Color> textChunk in styleMap) { System.Console.ForegroundColor = colorManager.GetConsoleColor(textChunk.Value); if (writeCount == styleMap.Count()) { System.Console.Write(textChunk.Key + trailer); } else { System.Console.Write(textChunk.Key); } writeCount++; } System.Console.ForegroundColor = oldSystemColor; #if !NET40 })).Wait(); #endif }
private static void MapToScreen(IEnumerable<KeyValuePair<string, Color>> styleMap, string trailer) { int writeCount = 1; foreach (KeyValuePair<string, Color> textChunk in styleMap) { System.Console.BackgroundColor = colorManager.GetConsoleColor(textChunk.Value); if (writeCount == styleMap.Count()) { System.Console.Write(textChunk.Key + trailer); } else { System.Console.Write(textChunk.Key); } writeCount++; } System.Console.ResetColor(); }