public void MainInteractor(string interactsignal, string invokesignalsymbol, int errorinteger)
        {
            var signalreceive = new SignalReceiver();                                   // Zero Component

            signalreceive.sendsignal(interactsignal, invokesignalsymbol, errorinteger); // Sends signal to SignalReceiver.cs
            // Note : ComponentInteractor is a part of FalconXOS's UFT(User-Friendly Terminal)
        }
        public void Verify(string stringtoverify)
        {
            var zero   = new ZeroSignal();
            var signal = new SignalReceiver();

            if (stringtoverify.Contains('#'))
            {
                // Add code for creating your own error handling system
            }
            else if (stringtoverify.Contains('!'))
            {
                zero.ReceiveSignal(stringtoverify);
            }
            else
            {
                Console.WriteLine("Error : The signal is neither signed nor unsigned");
                Console.WriteLine("Not acceptable signal, force exiting FalconXOS");
                Environment.Exit(0);
            }
        }
Beispiel #3
0
        public void MainStart() // Main Method
        {
            var componentInteractor = new ComponentInteractor();
            var signalverify        = new SignalVerifier();

            Console.Title = "FalconXOS(UFT)";             // Sets the title

            Console.ForegroundColor = ConsoleColor.White; // Sets the colour to the specified colour
            Console.Clear();                              // Clears the console


            Console.WriteLine("You can see the available commands by running '--help'"); // Run this command if you want to see the all the available commands
            Console.Write(">");
            string readFirstInput = Console.ReadLine();                                  // Waits for input

            if (readFirstInput == "--help")                                              // If the command is '--help'
            {
                Console.ForegroundColor = ConsoleColor.White;
                Console.WriteLine("Description                       Command\n\n");
                Console.WriteLine("Starts UFT                   start(forward : -uft, End : n)");
                Console.WriteLine("Exits the UFT                /command(forward : Exit(End))");
                Console.WriteLine("Go to 'note'                 /state(Forward : note(End))");
                Console.WriteLine("Skip to debug                /skip(Forward : -debug(End))");
                Console.WriteLine("Skip to 'shortcut'           /skip(Forward : shortcut(End))");
                Console.WriteLine("Skip to submenu              /skip(Forward : submenu(End))");
                Console.WriteLine("Start Terminal(Powershell)   /start(Forward : terminal(End))");
                Console.WriteLine("Access the changelog         --access(Forward : ch(End))");

                Console.Write(">");



                Boolean devstatus    = false;
                string  commandStart = Console.ReadLine();
                if (commandStart == "--devmode" || commandStart == "-sh=developer" || commandStart == "-sh=dev")
                {
                    devstatus = true;
                }

                if (commandStart == "start -uft n" || commandStart == "/start") // This commands goes to the menu
                {
                    viOne v = new viOne();
                    v.Start();
                }
                else if (commandStart == "/command Exit" || commandStart == "exit" || commandStart == "/Exit") // This exits the UFT
                {
                    var start = new startfi.startfi();
                    start.NonAddStart();
                }
                else if (commandStart == "/state note") // This goes to the class 'Note'
                {
                    Console.WriteLine("Starting class Note");
                    Thread.Sleep(100);
                    CommandsAll commandsAll = new CommandsAll();
                    commandsAll.Note();
                }
                else if (commandStart == "/skip -debug") // Goes to debug
                {
                    DebugManager manager = new DebugManager();
                    manager.Debug();
                }
                else if (commandStart == "/skip shortcut") // Goes to shortcut
                {
                    Shortcut shortcut = new Shortcut();
                    shortcut.ShortcutPage();
                }
                else if (commandStart == "/skip submenu") // Goes to submenu(viOne.cs)
                {
                    viOne v = new viOne();
                    v.vi();
                }
                else if (commandStart == "/start terminal") // Starts powershell
                {
                    close closeterminal = new close();
                    closeterminal.closeCommand();
                }
                else if (commandStart == "--access ch" || commandStart == "-sh=oldch")
                {
                    componentInteractor.MainInteractor("Access Changelog!", "/", 0);
                    MainStart();
                }
                else if (commandStart == "--runch" || commandStart == "-sh=ch")

                {
                    componentInteractor.MainInteractor("Dev Changelog!", "/", 0);
                    MainStart();
                }
                else if (commandStart == "--internal version" || commandStart == "--i v")
                {
                    var signalreceiver = new SignalReceiver();
                    componentInteractor.MainInteractor("Give version!", "/", 0);
                    MainStart();
                }
                else if (commandStart == "/clear" || commandStart == "--clear" || commandStart == "--sh=clear")
                {
                    Console.Clear();
                    MainStart();
                }
                else if (commandStart == "-d info")
                {
                    var signalreceiver = new SignalReceiver();
                    componentInteractor.MainInteractor("Request debug info!", "/", 0); // For now error-handling is manual, as you have to add the errornum for the error. In the next release, the error-handling should be automatic
                    MainStart();
                }
                else if (commandStart == "--devconsole")
                {
                    var devconsole = new dev.DevConsole();
                    devconsole.MainConsole();
                }

                else // When the wrong command is executed
                {
                    var gray = new Errortunnel();
                    gray.CheckInfo("/", 20, "None");

                    MainStart();
                }
            }
            else if (readFirstInput == "--howTo") // This command explains how to read '--help' commands
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("start(forward : -uft, End : n)");
                Console.WriteLine("In this the first command is : start, the 'forward' means the next attribute and 'End' means the last attribute of the command");
                Console.WriteLine("Note : sometimes in the 'forward' attribute there will be '(End)'. \nThis means that the 'forward' attribute is also the last attribute");
                Console.WriteLine("Type '/Exit' to close");
                Console.Write(">");
                string gRead = Console.ReadLine();
                if (gRead == "/Exit") // This command is used to exit this command
                {
                    MainStart();
                }
                else  // If the command is wrong
                {
                    var gray = new Errortunnel();
                    gray.CheckInfo("/", 20, "None");

                    MainStart();
                }
            }
            else if (readFirstInput == "start -uft n" || readFirstInput == "/start" || readFirstInput == "/Start" || readFirstInput == "/Menu") // When the listed command is executed
            {
                viOne v = new viOne();
                v.Start();
            }
            else if (readFirstInput == "/command Exit" || readFirstInput == "/Exit")
            {
                var start = new startfi.startfi();
                start.NonAddStart();
            }
            else if (readFirstInput == "/state note")
            {
                Console.WriteLine("Starting FalconXOS Note");

                Thread.Sleep(100);
                CommandsAll commandsAll = new CommandsAll();
                commandsAll.Note();
            }
            else if (readFirstInput == "/skip -debug")
            {
                DebugManager manager = new DebugManager();
                manager.Debug();
            }
            else if (readFirstInput == "/skip shortcut")
            {
                Shortcut shortcut = new Shortcut();
                shortcut.ShortcutPage();
            }
            else if (readFirstInput == "/skip submenu")
            {
                viOne v = new viOne();
                v.vi();
            }
            else if (readFirstInput == "start /terminal")
            {
                close closeterminal = new close();
                closeterminal.closeCommand();
            }
            else if (readFirstInput == "--access ch" || readFirstInput == "-sh=oldch")
            {
                componentInteractor.MainInteractor("Access Changelog!", "/", 0);
                MainStart();
            }
            else if (readFirstInput == "--runch" || readFirstInput == "-sh=ch")

            {
                componentInteractor.MainInteractor("Dev Changelog!", "/", 0);
                MainStart();
            }

            else if (readFirstInput == "--internal version" || readFirstInput == "--i v" || readFirstInput == "version")

            {
                componentInteractor.MainInteractor("Give version!", "/", 0);
                MainStart();
            }
            else if (readFirstInput == "/clear" || readFirstInput == "--clear" || readFirstInput == "--sh=clear")
            {
                Console.Clear();
                MainStart();
            }
            else if (readFirstInput == "-d info")
            {
                var signalreceiver = new SignalReceiver();
                signalreceiver.sendsignal("Request debug info!", "/", 0);
                Thread.Sleep(2000);
                Console.WriteLine("\nDo you want to exit?");
                string read = Console.ReadLine();
                if (read == "/exit" || read == "Exit" || read == "exit")
                {
                    MainStart();
                }
                else
                {
                    var errorinteractor = new ErrorInteractor();
                    errorinteractor.VerifyError("/", 20, "None");

                    MainStart();
                }
            }
            else if (readFirstInput == "--devconsole")
            {
                var devconsole = new dev.DevConsole();
                devconsole.MainConsole();
            }

            else
            {
                var gray = new Errortunnel();
                gray.CheckInfo("/", 20, "None");

                MainStart();
            }
        }
Beispiel #4
0
        public void MenuMain() // FalconXOS's Menu
        {
            var componentinteractor = new ComponentInteractor();
            var sendsignal          = new SignalVerifier();


            Console.Clear();                             // Clears the console
            Console.ForegroundColor = ConsoleColor.Cyan; // Sets the foregrounColor



            Console.WriteLine("Apps and other commands(type Apps for running this command)");
            Console.WriteLine("Shortcuts");
            Console.WriteLine("Debug.cs");
            Console.WriteLine("Debug.js");

            Console.WriteLine("QuickRun('run')");
            Console.WriteLine("Terminal(default)");

            Console.WriteLine("Project Manager");
            Console.WriteLine("Developer Console(--devconsole)");
            Console.WriteLine("Exit");
            Console.Write(">");
            string y = Console.ReadLine();

            if (y == "Apps") // When executimg the 'Apps' command
            {
                viOne b = new viOne();
                b.vi();
            }
            else if (y == "Shortcuts") // When executing the 'Shortcuts' command
            {
                Shortcut s = new Shortcut();
                s.ShortcutPage();
            }
            else if (y == "Terminal") // When executing the 'Terminal' command
            {
                TerminalKernel l = new TerminalKernel();
                l.TerminalHandler();
                Thread.Sleep(100);
                Console.WriteLine("Type Exit");
                Console.Write(">");
                string v = Console.ReadLine();
                if (v == "Exit")
                {
                    MenuMain();
                }
                else
                {
                    var gray = new Errortunnel();
                    gray.CheckInfo("/", 20, "None");
                    MenuMain();
                }
            }
            else if (y == "Exit" || y == "exit" || y == "/Exit" || y == "/exit") // When executing the 'Exit' command
            {
                componentinteractor.MainInteractor("Exit!", "/", 0);
            }
            else if (y == "Project Manager")
            {
                Utility m = new Utility();


                m.VirtualUtility();
            }
            else if (y == "/close menu")
            {
                Main k = new Main();
                k.MainStart();
            }
            else if (y == "Debug.cs")
            {
                var debug = new DebugManager();

                debug.Debug();
            }
            else if (y == "Debug.js")
            {
                var d = new DebugManager();
                d.JsDebug();
            }
            else if (y == "--help")
            {
                Console.WriteLine("Description                       Command\n\n");
                Console.WriteLine("Goes back to the Main Menu     /close(forward : menu(End))");
            }
            else if (y == "run")
            {
                var run = new QuickRun();
                run.QuickRunMethod();
            }
            else if (y == "--access ch" || y == "-=sh=oldch")

            {
                componentinteractor.MainInteractor("Access Changelog!", "/", 0);
                MenuMain();
            }
            else if (y == "--dev")
            {
                componentinteractor.MainInteractor("Dev Changelog!", "/", 0);
                MenuMain();
            }
            else if (y == "--internal version" || y == "--i v")
            {
                var signalreceiver = new SignalReceiver();
                componentinteractor.MainInteractor("Give version!", "/", 0);
                MenuMain();
            }
            else if (y == "/clear" || y == "--clear" || y == "--sh=clear")
            {
                Console.Clear();
                MenuMain();
            }
            else if (y == "-d info")
            {
                componentinteractor.MainInteractor("Request debug info!", "/", 0);
                MenuMain();
            }
            else if (y == "--devconsole")
            {
                var s = new dev.DevConsole();
                s.MainConsole();
            }
            else                                     // When the wrong command is executed
            {
                var gray = new Errortunnel();
                gray.CheckInfo("/", 20, "None");

                MenuMain();
            }
        }