Esempio n. 1
0
        public MainMenu AddSubMenu(SubMenu subMenu)
        {
            if (string.IsNullOrEmpty(subMenu.Name))
            {
                throw new ArgumentNullException(nameof(subMenu.Name), "No name set for submenu.");
            }

            subMenu.SetRoot(this);
            _subMenus.Add(subMenu.Name, subMenu);
            return(this);
        }
Esempio n. 2
0
 public MainMenu(Func <NodeBase, string, Task <HandlerResult> > defaultHandler = null)
 {
     _selectedMenu = new SubMenu(string.Empty, defaultHandler);
     _selectedMenu.SetRoot(this);
     _subMenus.Add(_selectedMenu.Name, _selectedMenu);
 }