public override string PreCmd(string line) { LookAndFeel.SetColorConsole(ConsoleColor.Gray, ConsoleColor.Black); if (ConfigUtil.DEBUG) { Console.WriteLine("Executing {0}", line); } return(base.PreCmd(line)); }
public Commander() { CommandPrompt = "met> "; HistoryFileName = "Typhoon"; LookAndFeel.SetColorConsole(ConsoleColor.Red, ConsoleColor.Black); Console.WriteLine("WARNING: Command History is on disk at : {0}{1}", System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), HistoryFileName), "._history"); LookAndFeel.ResetColorConsole(true); }
/// <summary> /// Invoke Interactive MET Console /// </summary> internal static void ModeConsole() { Console.Clear(); LookAndFeel.SetInitConsole("Typhoon", ConsoleColor.Red, ConsoleColor.Black); String intro = @" -= Typhoon Managed Execution Toolkit =- "; LookAndFeel.SetColorConsole(ConsoleColor.Red, ConsoleColor.Black); var commander = new Commander(); commander.CmdLoop(intro); }
private void replDCS() { bool replRunning = true; while (replRunning) { String dirLine = String.Empty; String codeLine = String.Empty; String directives = String.Empty; String code = String.Empty; LookAndFeel.ResetColorConsole(true); LookAndFeel.SetColorConsole(ConsoleColor.Yellow, ConsoleColor.Black); while (replRunning) { Console.Write("directive> "); dirLine = Console.ReadLine(); // Imeddiately exit REPL if (dirLine.StartsWith("QUIT")) { replRunning = false; break; } if (dirLine.StartsWith("END")) { break; } directives += dirLine; } while (replRunning) { Console.Write("code> "); codeLine = Console.ReadLine(); // Imeddiately exit REPL if (codeLine.StartsWith("QUIT")) { replRunning = false; break; } if (codeLine.StartsWith("END")) { break; } code += codeLine; } if (replRunning) { if (ConfigUtil.DEBUG) { Console.WriteLine("Directives: \n{0}, \nCode: \n{1}", directives, code); } LookAndFeel.SetColorConsole(ConsoleColor.Red, ConsoleColor.Black); Console.WriteLine("Perforing dynamic compile and execution."); if (!DynCSharpRunner.CompileRunSnippet(directives, code)) { Console.WriteLine("Errors in compilation..."); } LookAndFeel.ResetColorConsole(true); } else { return; } } }