示例#1
0
        protected void doSpecialCall(aceCommandActiveInput input)
        {
            switch (input.specialCall)
            {
            case ConsoleKey.F1:
                aceOperation_consoleHelp(aceCommandConsoleHelpOptions.full);
                break;

            case ConsoleKey.F2:
                aceOperation_consoleHelp(aceCommandConsoleHelpOptions.parameters);
                break;

            case ConsoleKey.F3:
                aceOperation_consoleHelp(aceCommandConsoleHelpOptions.plugins);
                break;

            case ConsoleKey.F4:
                var fi = "buffer.txt".getWritableFile(getWritableFileMode.autoRenameThis);
                saveBase.saveContentOnFilePath(consolePlatformExtensions.GetBuffer(), fi.FullName);
                output.log("Buffer content saved to: _" + fi.FullName + "_");
                break;

            case ConsoleKey.F12:
                break;

            case ConsoleKey.Escape:

                break;
            }
            doCustomSpecialCall(input);
        }
示例#2
0
        /// <summary>
        /// Starts the console
        /// </summary>
        public void start(IAceApplicationBase __application)
        {
            application = __application;

            cls();

            helpHeader.Add("Command with default parameters: [command name]");
            helpHeader.Add("For help on a command: [command name] " + aceCommandEntry.PARAM_HELP);
            helpHeader.Add("To be prompted for parameters: [command name] " + aceCommandEntry.PARAM_WILLCARD);
            // helpHeader.Add("[F1] full help | [F2] properties help | [F3] console plugins list | [F5] buffer to file");
            // helpHeader.Add("[DOWN] history back | [UP] history forward | [TAB] confirm proposal | [F12] clear screen");


            aceLog.consoleControl.setAsOutput(output);
            aceLog.consoleControl.setAsOutput(response);

            aceLog.consoleControl.makeSureHaveDifferentColors(output, response);

            // commandSetTree = commandTreeTools.BuildCommandTree(this);

            output.AppendLine(consoleTitle);
            output.AppendLine(consoleHelp);


            Console.Title = consoleTitle;

            commandSetTree.shortCuts.Add("F1", "help option=\"full\"");
            commandSetTree.shortCuts.Add("F12", "help option=\"full\"");

            onStartUp();


            history.Clear();

            while (consoleIsRunning)
            {
                if (useActiveInput)
                {
                    aceCommandActiveInput input = new aceCommandActiveInput(commandSetTree, history, "", "_>_ ");

                    Thread th = new Thread(input.run);
                    th.Start();
                    while (input.active)
                    {
                        Thread.Sleep(1000);
                    }

                    // aceTerminalInput.askForString("Please type console command and press enter.", "help");



                    if (input.specialCall != ConsoleKey.NoName)
                    {
                        executeCommand(input.current);
                    }
                    else
                    {
                        doSpecialCall(input);
                    }
                }
                else
                {
                    String input = aceTerminalInput.askForStringInline(linePrefix.or(" > "), DefaultCommand);
                    executeCommand(input);
                }



                Thread.Sleep(250);
            }

            aceLog.consoleControl.removeFromOutput(output);
            aceLog.consoleControl.removeFromOutput(response);
        }
示例#3
0
 protected abstract void doCustomSpecialCall(aceCommandActiveInput input);