void OpenFileForm_FormClosing(object sender, FormClosingEventArgs e) { AgentManager.Instance.RemoveAgent(this.Handle); removeWatchdogs(); Form form = new LectureManagerMainForm(); if (form != null) { LectureManagerMainForm mainForm = form as LectureManagerMainForm; mainForm.LectureFile = FileName; Utility.Windows.ShowForm(form); } }