Ejemplo n.º 1
0
        /// <summary>
        /// display disconnecting from the Finch robot
        /// </summary>
        static void DisplayDisconnectFinchRobot(Finch finchRobot)
        {
            DisplayScreenHeader("Disconnect the Finch Robot");

            Console.WriteLine("The Finch robot is about to be disconnected.");
            DisplayContinuePrompt();

            finchRobot.disConnect();
            Console.WriteLine();
            Console.WriteLine("The Finch robot is now disconnected.");

            DisplayContinuePrompt();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Display Main Menu
        /// </summary>
        static void DisplayMenu()
        {
            //
            // instantiate a Finch object
            //
            Finch finchRobot = new Finch();

            bool finchRobotConnected = false;
            bool quitApplication = false;
            string menuChoice;

            do
            {
                DisplayScreenHeader("Main Menu");

                Console.WriteLine("a) Connect Finch Robot");
                Console.WriteLine("b) Talent Show");
                Console.WriteLine("c) Data Recorder");
                Console.WriteLine("d) Alarm System");
                Console.WriteLine("e) User Programming");
                Console.WriteLine("f) Disconnect Finch Robot");
                Console.WriteLine("g) Set Theme");
                Console.WriteLine("q) Quit");
                Console.Write("Enter Choice:");
                menuChoice = Console.ReadLine().ToLower();

                switch (menuChoice)
                {
                    case "a":
                        finchRobotConnected = DisplayConnectFinchRobot(finchRobot);
                        break;
                    case "b":
                        if (finchRobotConnected) TalentShow(finchRobot);
                        else DisplayConnectionIssueInformation();
                        break;
                    case "c":
                        if (finchRobotConnected) DataRecorder(finchRobot);
                        else DisplayConnectionIssueInformation();
                        break;
                    case "d":
                        if (finchRobotConnected) AlarmSystem(finchRobot);
                        else DisplayConnectionIssueInformation();
                        break;
                    case "e":
                        if (finchRobotConnected) UserProgramming(finchRobot);
                        else DisplayConnectionIssueInformation();
                        break;
                    case "f":
                        DisplayDisconnectFinchRobot(finchRobot);
                        break;
                    case "g":
                        ThemeConfig();
                        break;
                    case "q":
                        finchRobot.disConnect();
                        quitApplication = true;
                        break;
                    default:
                        Console.WriteLine();
                        Console.WriteLine("Please provide a proper menu choice.");
                        DisplayContinuePrompt();
                        break;
                }
            } while (!quitApplication);

        }