Example #1
0
        private (int, bool) GetNumberAndMiddleNameInput()
        {
            Console.Write("How many would you like? ");
            int numberOfNames = Elicit.WholeNumber();

            Console.Write("Now, do you want middle names as well (y/n)? ");
            bool middleNames = GetYesOrNoAnswer();

            return(numberOfNames, middleNames);
        }
Example #2
0
        // After the names have been generated, what does the user want to do with them?
        private void NowWhat()
        {
            ConsoleMenuPainter.TextColor();
            bool finished = false;

            do
            {
                Console.Clear();
                Console.WriteLine($"OK, I've generated all {outputListOfNames.Count} names.");
                Console.WriteLine("What would you like to do?\n");
                int userChoice = Elicit.WhatNowMenu(0, 5); // the two digits are to place the menu on the x and y axis

                switch (userChoice)
                {
                case 0:
                    Console.Clear();
                    Console.WriteLine("Print the names to the screen\n");
                    PrintNames();
                    Console.WriteLine("\n\nHit enter to continue");
                    Console.ReadLine();
                    finished = true;
                    break;

                case 1:
                    Console.Clear();
                    Console.WriteLine("Print the names to a file\n");
                    FileStuff.WriteToFile(outputListOfNames, "ListOfNames.txt");
                    finished = true;
                    break;

                case 2:
                    Console.Clear();
                    Console.WriteLine("Both\n");
                    PrintNames();
                    FileStuff.WriteToFile(outputListOfNames, "ListOfNames.txt");
                    finished = true;
                    break;

                case 3:
                    Console.Clear();
                    Console.WriteLine("Quit");
                    Console.ResetColor();
                    finished = true;
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Default case");
                    finished = true;
                    break;
                }
            } while (!finished);
        }