private static SidebarPanel CreatePanel(string text, Control contents, bool insert = false) { var panel = new SidebarPanel { Text = text, Name = text, Dock = DockStyle.Fill, Hidden = !Expanded(text) }; panel.AddControl(contents); if (insert) _container.Insert(panel, _container.Count() - 1); else _container.Add(panel); return panel; }
private static void CreatePanel(string text, Control contents) { var panel = new SidebarPanel { Text = text, Dock = DockStyle.Fill, Hidden = !Expanded(text) }; panel.AddControl(contents); _container.Add(panel); }
private static SidebarPanel CreatePanel(string text, Control contents, bool insert = false) { var panel = new SidebarPanel { Text = text, Name = text, Dock = DockStyle.Fill, Hidden = !Expanded(text) }; panel.AddControl(contents); if (insert) { _container.Insert(panel, _container.Count() - 1); } else { _container.Add(panel); } return(panel); }