예제 #1
0
        public Edit()
        {
            Name           = "edit";
            Description    = "Edit test file.";
            ParameterCount = 2;
            ConsoleTextInputIO consoleTextInputIO = new ConsoleTextInputIO();

            editor = new TextEditor(consoleTextInputIO, false);
        }
예제 #2
0
        public static string GetCommand()
        {
            List <DirectoryEntry> directoryContents = new List <DirectoryEntry>();

            foreach (DirectoryEntry de in Global.FileSystem.GetDirectoryListing(Global.CurrentPath))
            {
                directoryContents.Add(de);
            }

            ConsoleTextInputIO consoleTextInputIO = new ConsoleTextInputIO();

            textInput = new TextInput(consoleTextInputIO, false);

            TextInputResult tir = textInput.GetText("");

            if (tir.ConsoleKeyInfo.Key == ConsoleKey.Enter)
            {
                if (tir.Result.Length > 0)
                {
                    string[] parms = Split(tir.Result, false);
                    Console.WriteLine();

                    switch (parms[0].ToLower())
                    {
                    case "help":
                        DisplayHelp(parms);
                        break;

                    default:
                        DetermineCommandType(parms);
                        break;
                    }
                }
            }
            else
            {
                // process special keys : TAB, Down\Up arrow, Function keys.
            }

            return(tir.Result);
        }