Ejemplo n.º 1
0
 public void AddMenuItem(MenuItemBase parent, params MenuItemBase[] displayMenuItem)
 {
     foreach (var menuItemDefinition in displayMenuItem)
     {
         if (MenuItemNameList.Contains(menuItemDefinition.Name))
         {
             throw new Exception("Menu item name duplicated");
         }
         parent.Children.Add(menuItemDefinition);
         MenuItemNameList.Add(menuItemDefinition.Name);
     }
 }
Ejemplo n.º 2
0
 public void AddMenu(params Menu[] menu)
 {
     foreach (var menuDefinition in menu)
     {
         if (MenuItemNameList.Contains(menuDefinition.Name))
         {
             throw new Exception("Menu item name duplicated");
         }
         Items.Add(menuDefinition);
         MenuItemNameList.Add(menuDefinition.Name);
     }
 }