public void BuildMenu()
        {
            SubMenu subMenu = new SubMenu("Show Date / Time", r_MainMenu);

            ActiveItem activeItem = new ActiveItem("Show Date", subMenu);

            activeItem.Notifier += new ShowDate().DoAction;
            subMenu.AddMenuItem(activeItem);

            activeItem           = new ActiveItem("Show Time", subMenu);
            activeItem.Notifier += new ShowTime().DoAction;
            subMenu.AddMenuItem(activeItem);

            r_MainMenu.AddMenuItem(subMenu);

            subMenu = new SubMenu("Version and Digits", r_MainMenu);

            activeItem           = new ActiveItem("Count Digits", subMenu);
            activeItem.Notifier += new CountDigits().DoAction;
            subMenu.AddMenuItem(activeItem);

            activeItem           = new ActiveItem("Show Version", subMenu);
            activeItem.Notifier += new ShowVersion().DoAction;
            subMenu.AddMenuItem(activeItem);

            r_MainMenu.AddMenuItem(subMenu);
        }
Пример #2
0
        public void BuildMenu()
        {
            SubMenu subMenu = new SubMenu("Show Date / Time", r_MainMenu);

            ActiveItem activeItem = new ActiveItem("Show Date", subMenu);

            activeItem.AddDoActionListener(new ShowDate() as IDoActionListener);
            subMenu.AddMenuItem(activeItem);

            activeItem = new ActiveItem("Show Time", subMenu);
            activeItem.AddDoActionListener(new ShowTime() as IDoActionListener);
            subMenu.AddMenuItem(activeItem);

            r_MainMenu.AddMenuItem(subMenu);

            subMenu = new SubMenu("Version and Digits", r_MainMenu);

            activeItem = new ActiveItem("Count Digits", subMenu);
            activeItem.AddDoActionListener(new CountDigits() as IDoActionListener);
            subMenu.AddMenuItem(activeItem);

            activeItem = new ActiveItem("Show Version", subMenu);
            activeItem.AddDoActionListener(new ShowVersion() as IDoActionListener);
            subMenu.AddMenuItem(activeItem);

            r_MainMenu.AddMenuItem(subMenu);
        }
Пример #3
0
        public static MainMenu GenerateMenus()
        {
            MainMenu mainMenu       = new MainMenu("Application");
            SubMenu  actionsAndInfo = new SubMenu("Actions And Info", 1);
            SubMenu  actions        = new SubMenu("Actions", 2);
            SubMenu  showDateTime   = new SubMenu("Show Date/Time", 2);
            MenuItem displayVersion = new MenuItem("Display Version", 1, displayVersionMethod);
            MenuItem countSpaces    = new MenuItem("Count Spaces", 1, countSpacesMethod);
            MenuItem charsCount     = new MenuItem("Chars Count", 2, countCharsMethod);
            MenuItem showTime       = new MenuItem("Show Time", 1, showTimeMethod);
            MenuItem showDate       = new MenuItem("Show Date", 2, showDateMethod);


            mainMenu.AddMenuItem(actionsAndInfo, 1);
            mainMenu.AddMenuItem(showDateTime, 2);

            actionsAndInfo.AddMenuItem(displayVersion, 1);
            actionsAndInfo.AddMenuItem(actions, 2);

            actions.AddMenuItem(countSpaces, 1);
            actions.AddMenuItem(charsCount, 2);

            showDateTime.AddMenuItem(showTime, 1);
            showDateTime.AddMenuItem(showDate, 2);

            return(mainMenu);
        }
        private void buildMainMenu()
        {
            m_MainMenu = new MainMenu(m_MainMenuText);
            SubMenu dateTimeSubMenu           = new SubMenu("Show Date / Time");
            SubMenu versionAndCapitalsSubMenu = new SubMenu("Version and Capitals");

            dateTimeSubMenu.AddMenuItem(new ActionMenu("Show Time", new ShowTime()));
            dateTimeSubMenu.AddMenuItem(new ActionMenu("Show Date", new ShowDate()));
            versionAndCapitalsSubMenu.AddMenuItem(new ActionMenu("Count Capitals", new CountCapitals()));
            versionAndCapitalsSubMenu.AddMenuItem(new ActionMenu("Show Version", new ShowVersion()));
            m_MainMenu.AddMenuItem(dateTimeSubMenu);
            m_MainMenu.AddMenuItem(versionAndCapitalsSubMenu);
        }
Пример #5
0
        private void createMenu()
        {
            m_MainMenu = new MainMenu("Interface Test Menu");
            SubMenu    showDateTime       = new SubMenu("Show Date/Time");
            MenuAction showTime           = new MenuAction("Show Time", new TimeView());
            MenuAction showDate           = new MenuAction("Show Date", new DateView());
            SubMenu    versionAndCapitals = new SubMenu("Version and Capitals");
            MenuAction countCapital       = new MenuAction("Count Capitals", new CountCapitals());
            MenuAction showVersion        = new MenuAction("Show Version", new VersionShower());

            m_MainMenu.AddMenuItem(showDateTime);
            m_MainMenu.AddMenuItem(versionAndCapitals);
            showDateTime.AddMenuItem(showTime);
            showDateTime.AddMenuItem(showDate);
            versionAndCapitals.AddMenuItem(countCapital);
            versionAndCapitals.AddMenuItem(showVersion);
        }
        private void buildMainMenu()
        {
            ActionMenu showTimeActionItem      = new ActionMenu("Show Time");
            ActionMenu showDateActionItem      = new ActionMenu("Show Date");
            ActionMenu countCapitalsActionItem = new ActionMenu("Count Capitals");
            ActionMenu showVersionActionItem   = new ActionMenu("Show Version");

            showTimeActionItem.Execution      += showTime;
            showDateActionItem.Execution      += showDate;
            countCapitalsActionItem.Execution += countCapitals;
            showVersionActionItem.Execution   += showVersion;
            SubMenu dateTimeSubMenu           = new SubMenu("Show Date / Time");
            SubMenu versionAndCapitalsSubMenu = new SubMenu("Version and Capitals");

            dateTimeSubMenu.AddMenuItem(showTimeActionItem);
            dateTimeSubMenu.AddMenuItem(showDateActionItem);
            versionAndCapitalsSubMenu.AddMenuItem(countCapitalsActionItem);
            versionAndCapitalsSubMenu.AddMenuItem(showVersionActionItem);
            m_MainMenu.AddMenuItem(dateTimeSubMenu);
            m_MainMenu.AddMenuItem(versionAndCapitalsSubMenu);
        }
Пример #7
0
        private void createMenu()
        {
            MainMenu = new MainMenu("Delegates Test Menu");
            SubMenu    showDateTime       = new SubMenu("Show Date/Time");
            MenuAction showTime           = new MenuAction("Show Time");
            MenuAction showDate           = new MenuAction("Show Date");
            SubMenu    versionAndCapitals = new SubMenu("version and capitals");
            MenuAction countCapital       = new MenuAction("Count Capitals");
            MenuAction showVersion        = new MenuAction("Show Version");

            MainMenu.AddMenuItem(showDateTime);
            MainMenu.AddMenuItem(versionAndCapitals);
            showDateTime.AddMenuItem(showTime);
            showDateTime.AddMenuItem(showDate);
            versionAndCapitals.AddMenuItem(showTime);
            versionAndCapitals.AddMenuItem(showDate);
            showTime.Selected     += new DateView().showDate;
            showTime.Selected     += new TimeView().showTime;
            countCapital.Selected += new CountCapitals().capitalsCounter;
            showVersion.Selected  += new VersionShower().showVersion;
        }
Пример #8
0
        public static MainMenu GenerateMenus()
        {
            MainMenu mainMenu       = new MainMenu("Application");
            SubMenu  actionsAndInfo = new SubMenu("Actions And Info", 1);
            SubMenu  actions        = new SubMenu("Actions", 2);
            SubMenu  showDateTime   = new SubMenu("Show Date/Time", 2);

            mainMenu.AddMenuItem(actionsAndInfo, 1);
            mainMenu.AddMenuItem(showDateTime, 2);

            actionsAndInfo.AddMenuItem(new DisplayVersion(), 1);
            actionsAndInfo.AddMenuItem(actions, 2);

            actions.AddMenuItem(new CountSpaces(), 1);
            actions.AddMenuItem(new CharsCount(), 2);

            showDateTime.AddMenuItem(new ShowTime(), 1);
            showDateTime.AddMenuItem(new ShowDate(), 2);

            return(mainMenu);
        }
Пример #9
0
        public static MainMenu BuildInterfaceMenu()
        {
            /// Create leaves:
            IAction  showVersionRunnable   = new TestExamples.ShowVersion();
            MenuItem actionItemShowVer     = new ActionItem("Show Version", showVersionRunnable);
            IAction  charsCountRunnable    = new TestExamples.CharsCount();
            MenuItem actionItemCharCount   = new ActionItem("Chars Count", charsCountRunnable);
            IAction  countSpacesRunnable   = new TestExamples.CountSpaces();
            MenuItem actionItemCountSpaces = new ActionItem("Count Spaces", countSpacesRunnable);
            IAction  showTimeRunnable      = new TestExamples.ShowTime();
            MenuItem actionItemShowTime    = new ActionItem("Show Time", showTimeRunnable);
            IAction  showDateRunnable      = new TestExamples.ShowDate();
            MenuItem actionItemShowDate    = new ActionItem("Show Date", showDateRunnable);

            /// Create sub menus:
            SubMenu subMenuActions = new SubMenu("Actions");

            subMenuActions.AddMenuItem(actionItemCharCount);
            subMenuActions.AddMenuItem(actionItemCountSpaces);
            SubMenu subMenuVerAndActions = new SubMenu("Version and Actions");

            subMenuVerAndActions.AddMenuItem(actionItemShowVer);
            subMenuVerAndActions.AddMenuItem(subMenuActions);
            SubMenu subMenuDateAndTime = new SubMenu("Show Date/Time");

            subMenuDateAndTime.AddMenuItem(actionItemShowTime);
            subMenuDateAndTime.AddMenuItem(actionItemShowDate);

            /// Create Main menu
            MainMenu mainMenu = new MainMenu();

            mainMenu.AddItemToMainMenu(subMenuVerAndActions);
            mainMenu.AddItemToMainMenu(subMenuDateAndTime);

            return(mainMenu);
        }
Пример #10
0
        public static MainMenu BuildDelegateMenu()
        {
            /// Create ActionItems:
            ActionItemFunctionDelegate showVersionFunction = new TestExamples.ShowVersion().Invoke;
            MenuItem actionItem1 = new ActionItem("Show Version", showVersionFunction);
            ActionItemFunctionDelegate charsCountFunction = new TestExamples.CharsCount().Invoke;
            MenuItem actionItem2 = new ActionItem("Chars Count", charsCountFunction);
            ActionItemFunctionDelegate countSpacesFunction = new TestExamples.CountSpaces().Invoke;
            MenuItem actionItem3 = new ActionItem("Count Spaces", countSpacesFunction);
            ActionItemFunctionDelegate showTimeFunction = new TestExamples.ShowTime().Invoke;
            MenuItem actionItem4 = new ActionItem("Show Time", showTimeFunction);
            ActionItemFunctionDelegate showDateFunction = new TestExamples.ShowDate().Invoke;
            MenuItem actionItem5 = new ActionItem("Show Date", showDateFunction);

            /// Create SubMenus:
            SubMenu subMenu1 = new SubMenu("Actions");

            subMenu1.AddMenuItem(actionItem2);
            subMenu1.AddMenuItem(actionItem3);
            SubMenu subMenu2 = new SubMenu("Version and Actions");

            subMenu2.AddMenuItem(actionItem1);
            subMenu2.AddMenuItem(subMenu1);
            SubMenu subMenu3 = new SubMenu("Show Date/Time");

            subMenu3.AddMenuItem(actionItem4);
            subMenu3.AddMenuItem(actionItem5);

            /// Create MainMenu
            MainMenu mainMenu = new MainMenu();

            mainMenu.AddItemToMainMenu(subMenu2);
            mainMenu.AddItemToMainMenu(subMenu3);

            return(mainMenu);
        }