예제 #1
0
        static public int dataMenu(string choice)
        {
            int iMainMenu;


            bool bMainMenu = true;

            while (bMainMenu)
            {
                //Test change
                Console.Write("\n");
                Console.WriteLine("-------MENU-------");
                Console.WriteLine("1.    Stack");
                Console.WriteLine("2.    Queue");
                Console.WriteLine("3.    Dictionary");
                Console.WriteLine("4.    Return to Bonus Features");
                Console.Write("Menu Selector: ");

                ErrorHandling check = new ErrorHandling();

                iMainMenu = check.Input("Menu Selector: ", 4);

                switch (iMainMenu)
                //goign through eachd of the case scenarios that we need to check
                {
                case 1:
                    manageStack.menuDisplay();

                    ErrorHandling checking = new ErrorHandling();

                    //checcking the information

                    int iStackMenu = checking.Input("Menu Selector: ", 7);

                    switch (iStackMenu)
                    {
                    case 1:
                        manageStack.addOne();
                        break;

                    case 2:
                        manageStack.addList();
                        break;

                    case 3:
                        manageStack.display();
                        break;



                    case 4:
                        manageStack.delete();
                        break;

                    case 5:
                        manageStack.clear();
                        break;

                    case 6:
                        manageStack.search();
                        break;

                    case 7:

                        Console.WriteLine("\n");
                        break;

                    default:
                        Console.WriteLine("Please enter a valid menu option");
                        break;
                    }
                    break;

                case 2:
                    Queue.menu();

                    break;

                case 3:
                    Dictionary.menu();
                    break;

                case 4:
                    return(0);

                    break;

                default:
                    Console.Write("Please enter a valid menu option");
                    break;
                }



                //end of second while
            } // end of while
            Console.ReadLine();
            return(0);
        } // end of dataStrucures