protected virtual void CreateItem(Controls.Ribbon.Ribbon ribbon, RibbonItemCollection collection, Type t) { IDesignerHost host = GetService(typeof(IDesignerHost)) as IDesignerHost; if (host != null && collection != null && ribbon != null) { DesignerTransaction transaction = host.CreateTransaction("AddRibbonItem_" + Component.Site.Name); MemberDescriptor member = TypeDescriptor.GetProperties(Component)["Items"]; base.RaiseComponentChanging(member); RibbonItem item = host.CreateComponent(t) as RibbonItem; if (!(item is RibbonSeparator)) item.Text = item.Site.Name; collection.Add(item); ribbon.OnRegionsChanged(); base.RaiseComponentChanged(member, null, null); transaction.Commit(); } }