private void 偏好设置PToolStripMenuItem_Click(object sender, EventArgs e) { if (preferenceForm != null) { preferenceForm.Activate(); } else { preferenceForm = new PreferenceForm(); preferenceForm.Show(); preferenceForm.Activate(); preferenceForm.FormClosed += preferenceFormClosed; } }
void preferenceFormClosed(object sender, FormClosedEventArgs e) { preferenceForm.Dispose(); preferenceForm = null; Utils.ReleaseMemory(true); }