AddHost() public method

Adds a host to the drop-down.
public AddHost ( ToolStripControlHost host ) : void
host System.Windows.Forms.ToolStripControlHost
return void
		/// ------------------------------------------------------------------------------------
		/// <summary>
		///
		/// </summary>
		/// ------------------------------------------------------------------------------------
		private void ReadToolbarItems(XmlNode node, object parentItem)
		{
			while (node != null)
			{
				ToolStripItem item = ReadSingleItem(node, false);

				if (parentItem is ToolStrip)
					((ToolStrip)parentItem).Items.Add(item);
				else if (parentItem is ToolStripDropDownItem)
				{
					ToolStripDropDownItem pItem = (ToolStripDropDownItem)parentItem;

					// If the parent item's drop-down type is a menu,
					// then make sure the text shows.
					if (pItem.DropDown is ToolStripDropDownMenu)
						item.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;

					if (!(item is ToolStripControlHost))
						pItem.DropDownItems.Add(item);
					else
					{
						// When we're a control host then put ourselves inside a CustomDropDown.
						CustomDropDown dropDown = new CustomDropDown();
						dropDown.AddHost(item as ToolStripControlHost);
						dropDown.AutoCloseWhenMouseLeaves = false;
						pItem.DropDown = dropDown;
					}
				}

				// This must be done after the item has been added to a item collection.
				item.Visible = GetBoolFromAttribute(node, "visible", true);

				if (node.ChildNodes.Count > 0)
					ReadToolbarItems(node.FirstChild, item);

				node = ReadOverJunk(node.NextSibling);
			}
		}