/// <summary> /// Handles when the overflow menu should be entirely destroyed /// </summary> /// <param name="sender">Sender of this Event</param> /// <param name="e">Event arguments</param> private void OverflowDestroyed(Object sender, EventArgs e) { //check we have the right type if (sender.GetType() == typeof(SEAddressBarDropDownButton)) { //get the button as the right type SEAddressBarDropDownButton tsddb = (SEAddressBarDropDownButton)sender; //if the button is no longer visible if (tsddb.Visible == false) { //clear all items from the overflow //this._overflowButton.DropDown.Items.Clear(); this._overflowDropDown.Items.Clear(); } } }
/// <summary> /// 创建指定地址栏项的子级(如果需要) /// </summary> /// <param name="button"></param> private void BuildChildItem(SEAddressBarButton button) { IAddressNode addressNode = button.AddressNode; SEAddressBarDropDownButton dropDownButton = null; //SEAddressBarDropDown dropDown = null; if (addressNode.Children != null && addressNode.Children.Length > 0) { dropDownButton = new SEAddressBarDropDownButton(String.Empty); button.DropDownButton = dropDownButton; //check if we have any tag data (we cache already built drop down items in the node TAG data. if (addressNode.DropDownMenu == null) { addressNode.DropDownMenu = GetButtonDropDown(addressNode); } else { if (addressNode.DropDownMenu.GetType() == typeof(SEAddressBarDropDown)) { //dropDown = (SEAddressBarDropDown)addressNode.DropDownMenu; foreach (SEAddressBarDropDownItem tsmi in addressNode.DropDownMenu.Items) { if (tsmi.Font.Style != _baseFont.Style) { tsmi.Font = _baseFont; } } } } dropDownButton.DropDown = addressNode.DropDownMenu; dropDownButton.DisplayStyle = ToolStripItemDisplayStyle.None; dropDownButton.ImageAlign = ContentAlignment.MiddleCenter; } }