public override void OnClick(EventArgs e) { Form[] all = this.parent.FindMdiForms(); Form activeMdiChild = this.parent.GetMainMenu().GetFormUnsafe().ActiveMdiChild; if (((all != null) && (all.Length > 0)) && (activeMdiChild != null)) { System.Windows.Forms.IntSecurity.AllWindows.Assert(); try { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(activeMdiChild, all); if (dialog.ShowDialog() == DialogResult.OK) { dialog.ActiveChildForm.Activate(); if ((dialog.ActiveChildForm.ActiveControl != null) && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } finally { CodeAccessPermission.RevertAssert(); } } }
/// <devdoc> handler for More Windows... This is similar to MenuItem.cs</devdoc> private void OnMoreWindowsMenuItemClick(object sender, EventArgs e) { Form[] forms = mdiParent.MdiChildren; if (forms != null) { // SECREVIEW : "System" style dialog, no user code will execute, and // : we don't want the restricted dialog options... // IntSecurity.AllWindows.Assert(); try { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(mdiParent.ActiveMdiChild, forms); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { // AllWindows Assert above allows this... // dialog.ActiveChildForm.Activate(); if (dialog.ActiveChildForm.ActiveControl != null && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } finally { CodeAccessPermission.RevertAssert(); } } }
/// <devdoc> handler for More Windows... This is similar to MenuItem.cs</devdoc> private void OnMoreWindowsMenuItemClick(object sender, EventArgs e) { Form[] forms = mdiParent.MdiChildren; if (forms != null) { // IntSecurity.AllWindows.Assert(); try { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(mdiParent.ActiveMdiChild, forms); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { // AllWindows Assert above allows this... // dialog.ActiveChildForm.Activate(); if (dialog.ActiveChildForm.ActiveControl != null && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } finally { CodeAccessPermission.RevertAssert(); } } }
private void OnMoreWindowsMenuItemClick(object sender, EventArgs e) { Form[] mdiChildren = this.mdiParent.MdiChildren; if (mdiChildren != null) { IntSecurity.AllWindows.Assert(); try { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(this.mdiParent.ActiveMdiChild, mdiChildren); if (dialog.ShowDialog() == DialogResult.OK) { dialog.ActiveChildForm.Activate(); if ((dialog.ActiveChildForm.ActiveControl != null) && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } finally { CodeAccessPermission.RevertAssert(); } } }
private void OnMoreWindowsMenuItemClick(object sender, EventArgs e) { Form[] forms = mdiParent.MdiChildren; if (forms is not null) { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(mdiParent.ActiveMdiChild, forms); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { // AllWindows Assert above allows this... // dialog.ActiveChildForm.Activate(); if (dialog.ActiveChildForm.ActiveControl is not null && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } }
public override void OnClick(EventArgs e) { Form[] forms = parent.FindMdiForms(); Debug.Assert(forms != null, "Didn't get a list of the MDI Forms."); Form active = parent.GetMainMenu().GetFormUnsafe().ActiveMdiChild; Debug.Assert(active != null, "Didn't get the active MDI child"); if (forms != null && forms.Length > 0 && active != null) { // SECREVIEW : "System" style dialog, no user code will execute, and // : we don't want the restricted dialog options... // IntSecurity.AllWindows.Assert(); try { using (MdiWindowDialog dialog = new MdiWindowDialog()) { dialog.SetItems(active, forms); DialogResult result = dialog.ShowDialog(); if (result == DialogResult.OK) { // AllWindows Assert above allows this... // dialog.ActiveChildForm.Activate(); if (dialog.ActiveChildForm.ActiveControl != null && !dialog.ActiveChildForm.ActiveControl.Focused) { dialog.ActiveChildForm.ActiveControl.Focus(); } } } } finally { CodeAccessPermission.RevertAssert(); } } }