ICSharpCode.Core.MenuService.AddItemsToMenu C# (CSharp) Method

AddItemsToMenu() public static method

public static AddItemsToMenu ( ToolStripItemCollection collection, object owner, string addInTreePath ) : void
collection System.Windows.Forms.ToolStripItemCollection
owner object
addInTreePath string
return void
        public static void AddItemsToMenu(ToolStripItemCollection collection, object owner, string addInTreePath)
        {
            ArrayList buildItems = AddInTree.GetTreeNode(addInTreePath).BuildChildItems(owner);
            foreach (object item in buildItems) {
                if (item is ToolStripItem) {
                    collection.Add((ToolStripItem)item);
                    if (item is IStatusUpdate)
                        ((IStatusUpdate)item).UpdateStatus();
                } else {
                    ISubmenuBuilder submenuBuilder = (ISubmenuBuilder)item;
                    collection.AddRange(submenuBuilder.BuildSubmenu(null, owner));
                }
            }
        }