public RibbonButtonList(IEnumerable <RibbonButton> buttons, IEnumerable <RibbonItem> dropDownItems) : this() { if (buttons != null) { var items = new List <RibbonButton>(buttons); _buttons.AddRange(items.ToArray()); //add the handlers foreach (RibbonItem item in buttons) { item.Click += item_Click; } } if (dropDownItems != null) { _dropDownItems.AddRange(dropDownItems); //add the handlers foreach (var item in dropDownItems) { item.Click += item_Click; } } }
/// <summary> /// Creates a new RibbonPanel with the specified text and panel flow direction /// </summary> /// <param name="text">Text of the panel</param> /// <param name="flowsTo">Flow direction of the content items</param> public RibbonPanel(string text, RibbonPanelFlowDirection flowsTo, IEnumerable <RibbonItem> items) : this() { _text = text; _flowsTo = flowsTo; _items.AddRange(items); }