Example #1
0
        public LoadCommander()
        {
            LookAndFeel.ResetColorConsole(true);
            // Intro is the text that gets displayed when the (sub-)shell starts.
            Intro = "Loader for resources\n========================\n\n";

            CommandPrompt   = "met/load> ";
            HistoryFileName = "Typhoon";
        }
Example #2
0
 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);
 }
Example #3
0
 public override void PostCmd(string line)
 {
     base.PostCmd(line);
     LookAndFeel.ResetColorConsole(true);
 }
Example #4
0
        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;
                }
            }
        }