private void f_Screen_FormClosing(object sender, FormClosingEventArgs e) { if (child != null) { child.Close(); } if (pw != null) { pw.Close(); } foreach (var v in Controls) { if (v != null && v is uc_CutoutHolder) { ((uc_CutoutHolder)v).Dispose(); } } try { GC.AddMemoryPressure(GC.GetTotalMemory(true)); GC.Collect(Int32.MaxValue, GCCollectionMode.Forced, true); } catch { } parent.Activate(); }
private void btn_Settings_Click(object sender, EventArgs e) { int panel = Properties.Settings.Default.s_ToolbarPanel; if (panel == 0) { if (tools != null && !tools.IsDisposed) { try { tools.Close(); } catch { } } else if (fs != null && !fs.IsDisposed) { tools = new f_SettingPanel(); tools.parent = fs; fs.child = tools; tools.Show(); } } else if (panel == 1) { if (fs != null && !fs.IsDisposed) { fs.togglePanel(); } } else if (panel == 2) { if (fs != null && !fs.IsDisposed) { fs.toggleToolbar(); } } }