Example #1
0
        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);
        }
Example #2
0
 private static void RemovePanel(SidebarPanel panel)
 {
     _container.Remove(panel);
     panel.Controls.Clear();
     panel.Dispose();
 }