/// <summary> /// Implements the OnShutdown event /// </summary> /// <param name="application"></param> /// <returns></returns> public Result OnShutdown(UIControlledApplication application) { if (m_MyForm != null && !m_MyForm.IsDisposed) { m_MyForm.Dispose(); m_MyForm = null; // if we've had a dialog, we had subscribed application.Idling -= IdlingHandler; } return(Result.Succeeded); }