コード例 #1
0
ファイル: viOne.cs プロジェクト: DaVikingMan/TerminalXOS
        // Command Class
        public void vi()
        {
            Console.ForegroundColor = ConsoleColor.Cyan;   // Sets the colour of text to the colour specified



            Console.Clear();

            Console.WriteLine("Which command do you want to execute?");


            List <commands> cm = ListManager.Manager();

            foreach (var m in cm)
            {
                Console.WriteLine($"{m.command1}\n{m.command2}\n{m.command3}\n{m.command4}");             // Lists the command from 'ListManager.cs'
            }
            Console.Write("> ");
            string commandRead = Console.ReadLine();


            if (commandRead == "Exit")
            {
                Menu commands = new Menu();
                commands.MenuMain();
            }


            else if (commandRead == "UFT Info")            // If the user types the following command
            {
                CommandsAll commands = new CommandsAll();
                commands.TerminalInfo("");
            }

            else if (commandRead == "ListMaker")
            {
                CommandsAll commands = new CommandsAll();
                commands.ListMaker("");
            }
            else if (string.IsNullOrWhiteSpace(commandRead))
            {
                Console.WriteLine("Kindly input value");
                Console.ReadKey();
                vi();
            }

            else if (commandRead == "WritePad")
            {
                CommandsAll v = new CommandsAll();
                v.WriteConsolePad();
            }
            else
            {
                Console.WriteLine("Wrong command");
                Thread.Sleep(100);
                viOne v = new viOne();
                v.vi();
            }
        }