private void CloseMenuItem_Click(object sender, EventArgs e) { if (this.ActiveMdiChild is LogForm) { logging.Close(); logging.Dispose(); logging = null; } else if (this.ActiveMdiChild != null) { this.ActiveMdiChild.Close(); } }
private void CloseMenuItem_Click(object sender, EventArgs e) { try { if (this.ActiveMdiChild is LogForm) { logging.Close(); logging.Dispose(); logging = null; } else { using (Viewer child = (Viewer)this.ActiveMdiChild) { child.Close(); } System.GC.Collect(); } } catch { } }
private void ToggleLogging() { if (logging == null) { logging = new LogForm(); logging.MdiParent = this; logging.WindowState = FormWindowState.Maximized; logging.Show(); } else { logging.Close(); logging.Dispose(); logging = null; } LoggingToolStripMenuItem.Checked = (logging != null); }
public override async Task StopAsync() { Global.MainForm.Invoke(() => { _form.Close(); }); await StopGuardAsync(); }