public static void BeforeCommand() { if (cd == Kernel.current_volume) { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); Console.ForegroundColor = ConsoleColor.White; } else { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write(cd + "~ "); Console.ForegroundColor = ConsoleColor.White; } }
/// <summary> /// Display the line before the user input and set the console color. /// </summary> private static void BeforeCommand() { if (current_directory == @"0:\") { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); Console.ForegroundColor = ConsoleColor.White; } else { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write(current_directory + "~ "); Console.ForegroundColor = ConsoleColor.White; } }
/// <summary> /// Display the line before the user input and set the console color. /// </summary> private static void BeforeCommand() { if (current_directory == @"0:\") { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); if (color == 0) { Console.ForegroundColor = ConsoleColor.Black; } else if (color == 1) { Console.ForegroundColor = ConsoleColor.Blue; } else if (color == 2) { Console.ForegroundColor = ConsoleColor.Green; } else if (color == 3) { Console.ForegroundColor = ConsoleColor.DarkBlue; } else if (color == 4) { Console.ForegroundColor = ConsoleColor.Red; } else if (color == 5) { Console.ForegroundColor = ConsoleColor.Magenta; } else if (color == 6) { Console.ForegroundColor = ConsoleColor.Yellow; } else if (color == 7) { Console.ForegroundColor = ConsoleColor.White; } else { Console.ForegroundColor = ConsoleColor.White; } } else { Console.ForegroundColor = ConsoleColor.Blue; Console.Write(UserLevel.TypeUser()); Console.ForegroundColor = ConsoleColor.Yellow; Console.Write(userLogged); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write("@"); Console.ForegroundColor = ConsoleColor.Blue; Console.Write(ComputerName); Console.ForegroundColor = ConsoleColor.Gray; Console.Write("> "); Console.ForegroundColor = ConsoleColor.DarkGray; Console.Write(current_directory + "~ "); if (color == 0) { Console.ForegroundColor = ConsoleColor.Black; } else if (color == 1) { Console.ForegroundColor = ConsoleColor.Blue; } else if (color == 2) { Console.ForegroundColor = ConsoleColor.Green; } else if (color == 3) { Console.ForegroundColor = ConsoleColor.DarkBlue; } else if (color == 4) { Console.ForegroundColor = ConsoleColor.Red; } else if (color == 5) { Console.ForegroundColor = ConsoleColor.Magenta; } else if (color == 6) { Console.ForegroundColor = ConsoleColor.Yellow; } else if (color == 7) { Console.ForegroundColor = ConsoleColor.White; } else { Console.ForegroundColor = ConsoleColor.White; } } }