/// <summary>Adds the tab panel to a parent container and returns it.</summary> /// <param name="container">The parent container onto which to add the container defined by this interface.</param> /// <returns>The newly added tab panel.</returns> public override Control AddTo(Control container) { TabPanel p = new TabPanel(); p.ID = Name; p.TabText = GetLocalizedText("TabText") ?? TabText; p.RegisterTabCss = registerTabCss; if (string.IsNullOrEmpty(CssClass)) { p.CssClass = "tabPanel primaryTabs"; var parentTab = container.Closest(c => c is TabPanel || c is ItemEditor); if (parentTab != null) { p.CssClass = "tabPanel " + parentTab.ClientID + "Tabs"; } } else p.CssClass = CssClass; container.Controls.Add(p); return p; }