private SimpleActionInterface FirstControlOfTabPage(TabPage tp) { if (tp != null && tp.Controls != null && tp.Controls.Count > 0) { Control first = tp.Controls[0]; SimpleActionInterface sai = first as SimpleActionInterface; return(sai); } return(null); }
private void HandleUserLevelChanged() { btnLogout.Visible = Program.UserLevel > UserLevels.USER; foreach (TabPage tp in tabs.TabPages) { SimpleActionInterface sai = FirstControlOfTabPage(tp); if (sai != null) { sai.UserLevelChanged(); } } }
private void HandleCloseTab() { if (return_tab != null) { tabs.SelectedTab = return_tab; SimpleActionInterface sai = FirstControlOfTabPage(return_tab); if (sai != null) { sai.Selected(); sai.UserLevelChanged(); } } }