void HandleHandleWillClose (object sender, EventArgs e) { if (NSApplication.SharedApplication.ModalWindow == this) { m_parent.Close(); } }