public void ClearSPanelEmptyEvents() { var evs = SPanelEmpty.GetInvocationList(); foreach (var e in evs) { SPanelEmpty -= e as PanelEmptyHandler; } }
public SplitPanel(int l) { InitializeComponent(); lPanel = new GroupPanel(l) { Dock = DockStyle.Fill }; rPanel = new GroupPanel(l) { Dock = DockStyle.Fill }; lPanel.TabEmpty += lPanel_TabEmpty; lPanel.OnFocused += GPanel_OnFocused; rPanel.TabEmpty += rPanel_TabEmpty; rPanel.OnFocused += GPanel_OnFocused; cPanel = lPanel; DoubleBuffered = true; SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); scPanel.Panel1.Controls.Add(lPanel); scPanel.Panel2.Controls.Add(rPanel); void lPanel_TabEmpty() { SPanelEmpty?.Invoke(rPanel); } void rPanel_TabEmpty() { SPanelEmpty?.Invoke(lPanel); } void GPanel_OnFocused(GroupPanel gp) { cPanel = gp; } }