private static Delegates.MainMenu createDelegateMenu()
        {
            List <Delegates.MenuItem> showDateAndTime = new List <Delegates.MenuItem>();

            Delegates.MenuItem showTime = new Delegates.LeafItem("Show Time", new MenuActions.ShowDateTimeData("HH:mm:ss").ExecuteAction);
            Delegates.MenuItem showDate = new Delegates.LeafItem("Show Date", new MenuActions.ShowDateTimeData("dd-MM-yyyy").ExecuteAction);
            showDateAndTime.Add(showTime);
            showDateAndTime.Add(showDate);
            List <Delegates.MenuItem> showVersionAndDigits = new List <Delegates.MenuItem>();

            Delegates.MenuItem countDigits = new Delegates.LeafItem("Count Digits", new MenuActions.CountDigits().ExecuteAction);
            Delegates.MenuItem showVersion = new Delegates.LeafItem("Show Version", new MenuActions.ShowVersion().ExecuteAction);
            showVersionAndDigits.Add(countDigits);
            showVersionAndDigits.Add(showVersion);
            Delegates.MenuItem        showDateAndTimeItem      = new Delegates.NodeItem("Show Date/Time", showDateAndTime);
            Delegates.MenuItem        showVersionAndDigitsItem = new Delegates.NodeItem("Version and Digits", showVersionAndDigits);
            List <Delegates.MenuItem> delgateMenuItems         = new List <Delegates.MenuItem>();

            Delegates.MainMenu delegateMenu = new Delegates.MainMenu("Delegate Menu", delgateMenuItems);
            delegateMenu.AddItemToMenu(showDateAndTimeItem);
            delegateMenu.AddItemToMenu(showVersionAndDigitsItem);

            return(delegateMenu);
        }
Beispiel #2
0
 public void AddItemToMenu(ExecutableItem i_MenuItemToAdd)
 {
     m_MainMenu.AddItemToMenu(i_MenuItemToAdd);
 }