public static void PopulateMenuWithItems(this System.Windows.Forms.Menu menu, IEnumerable <BufermanMenuItem> menuItems) { foreach (var menuItem in menuItems) { menu.MenuItems.Add((menuItem as FormMenuItem).GetMenuItem()); } }
private MenuItemCollectionWin CreateMenuItemCollectionWin() { System.Windows.Forms.Menu menu = (System.Windows.Forms.Menu)GetControlFactory().CreateMainMenu(); System.Windows.Forms.Menu.MenuItemCollection menuItemCollection = new System.Windows.Forms.Menu.MenuItemCollection(menu); return(new MenuItemCollectionWin(menuItemCollection)); }