//----------------------------------------------------------------- public bool QueryClose() { ArrayList lst = new ArrayList(((Crownwood.Magic.Controls.TabControl)m_tabs.ActiveLeaf.GroupControl).TabPages); foreach (Crownwood.Magic.Controls.TabPage page in lst) { IFormNavigable form = page.Control as IFormNavigable; if (!form.QueryClose()) { return(false); } } return(true); }
private void CFormNavigateur_FormClosing(object sender, FormClosingEventArgs e) { if (e.Cancel) { return; } foreach (Crownwood.Magic.Controls.TabPage page in ((Crownwood.Magic.Controls.TabControl)m_tabs.ActiveLeaf.GroupControl).TabPages) { IFormNavigable form = page.Control as IFormNavigable; if (!form.QueryClose()) { e.Cancel = true; return; } } }
//--------------------------------------------------------------------------- protected bool CloseForm(IFormNavigable form) { foreach (Crownwood.Magic.Controls.TabPage page in ((Crownwood.Magic.Controls.TabControl)m_tabs.ActiveLeaf.GroupControl).TabPages) { if (page.Control == form) { if (form.QueryClose()) { ((Crownwood.Magic.Controls.TabControl)m_tabs.ActiveLeaf.GroupControl).TabPages.Remove(page); page.Dispose(); return(true); } } } return(false); }