| | |
| | | int y = rectangle.Top + (rectangle.Height - GetItemsHeight()) / 2; |
| | | |
| | | MoveTo(items, new Point(x, y)); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | // A DropDown menu |
| | | //if (item is RibbonDescriptionMenuItem) |
| | | //{ |
| | | // throw new ApplicationException("The only style supported by the RibbonButtonList is Normal"); |
| | | // throw new ArgumentException("The only style supported by the RibbonButtonList is Normal", nameof(item)); |
| | | //} |
| | | } |
| | | else |
| | |
| | | // A Panel |
| | | if (item is RibbonDescriptionMenuItem) |
| | | { |
| | | throw new ApplicationException("The RibbonDescriptionMenuItem item is not supported on a panel"); |
| | | throw new ArgumentException("The RibbonDescriptionMenuItem item is not supported on a panel", nameof(item)); |
| | | } |
| | | } |
| | | } |
| | |
| | | /// <param name="items">Items to add</param> |
| | | public override void AddRange(IEnumerable<RibbonItem> items) |
| | | { |
| | | |
| | | |
| | | foreach (RibbonItem item in items) |
| | | { |
| | | CheckRestrictions(item); |
| | |
| | | item.SetOwner(Owner); |
| | | item.SetOwnerPanel(OwnerPanel); |
| | | item.SetOwnerTab(OwnerTab); |
| | | item.SetOwnerItem(OwnerItem); |
| | | |
| | | base.Insert(index, item); |
| | | } |