예제 #1
0
        /// <summary>
        /// This method generates a main menu for data manager methods as requested in Ex04
        /// This construction is done by adding actions (each action gets title, Interface object and Method Name that represents which
        /// method to perform
        /// </summary>
        /// <returns></returns>
        private Interfaces.MainMenu generateSpecificMainMenuRequiredForEx04()
        {
            Ex04.Menus.Interfaces.MainMenu specificEx04Menu = new Ex04.Menus.Interfaces.MainMenu("Main Menu");

            specificEx04Menu.AddMenuItemToMenu(new Ex04.Menus.Interfaces.ActionItem("Show Welcome", this, "ShowWelcome"));
            specificEx04Menu.AddMenuItemToMenu(generateSpecificSubMenuRequiredForEx04());
            specificEx04Menu.AddMenuItemToMenu(new Ex04.Menus.Interfaces.ActionItem("Show Version", this, "ShowVersion"));

            return(specificEx04Menu);
        }
예제 #2
0
 public void BuildMenu()
 {
     Ex04.Menus.Interfaces.MainMenu menu1    = new Ex04.Menus.Interfaces.MainMenu();
     Ex04.Menus.Interfaces.SubMenu  subMenu1 = new Ex04.Menus.Interfaces.SubMenu("Show Date/Time");
     Ex04.Menus.Interfaces.SubMenu  subMenu2 = new Ex04.Menus.Interfaces.SubMenu("Version and Capitals");
     menu1.AddMenu(subMenu1);
     subMenu1.AddMenu(new ShowDate());
     subMenu1.AddMenu(new ShowTime());
     menu1.AddMenu(subMenu2);
     subMenu2.AddMenu(new ShowVersion());
     subMenu2.AddMenu(new CountCapitals());
     menu1.Show();
 }
예제 #3
0
        public static void Main()
        {
            Ex04.Menus.Interfaces.MainMenu menuInterface = new Ex04.Menus.Interfaces.MainMenu();
            AppTestInterface appInterface = new AppTestInterface(menuInterface);

            Console.WriteLine("You'll be taken to the second menu in a few seconds ...");
            System.Threading.Thread.Sleep(3000);

            Ex04.Menus.Delegates.MainMenu menuDelegate = new Ex04.Menus.Delegates.MainMenu();
            AppTestDelegate appDelegates = new AppTestDelegate(menuDelegate);

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
예제 #4
0
        private static Ex04.Menus.Interfaces.MainMenu buildInterfaceMenu()
        {
            Ex04.Menus.Interfaces.MainMenu mainMenu = new Ex04.Menus.Interfaces.MainMenu("Main Menu (Interfaces)");

            Ex04.Menus.Interfaces.SubMenu versionAndCapitals = new Ex04.Menus.Interfaces.SubMenu("Version and Capitals");
            versionAndCapitals.Add(new Ex04.Menus.Interfaces.ActionItem("Count Capitals", new MenuOptionsForTester.CountCaptials()));
            versionAndCapitals.Add(new Ex04.Menus.Interfaces.ActionItem("Show Version", new MenuOptionsForTester.ShowVersion()));
            mainMenu.Add(versionAndCapitals);

            Ex04.Menus.Interfaces.SubMenu dateAndTime = new Ex04.Menus.Interfaces.SubMenu("Show Date/Time");
            dateAndTime.Add(new Ex04.Menus.Interfaces.ActionItem("Show Time", new MenuOptionsForTester.ShowCurrTime()));
            dateAndTime.Add(new Ex04.Menus.Interfaces.ActionItem("Show Date", new MenuOptionsForTester.ShowCurrDate()));
            mainMenu.Add(dateAndTime);

            return(mainMenu);
        }
예제 #5
0
 public DataManagerInterface()
 {
     m_DataManagerMainMenu = generateSpecificMainMenuRequiredForEx04();
 }
예제 #6
0
 public static void RunInterfacesMenutest()
 {
     Ex04.Menus.Interfaces.MainMenu mainMenu = buildInterfaceMenu();
     mainMenu.Show();
 }