public virtual void RemoveWindow(IFwMainWnd fwMainWindow)
{
if (IsDisposed || BeingDisposed)
return;
if (!m_rgMainWindows.Contains(fwMainWindow))
return; // It isn't our window.
// NOTE: The main window that was passed in is most likely already disposed, so
// make sure we don't call anything that would throw an ObjectDisposedException!
m_rgMainWindows.Remove(fwMainWindow);
Form form = (Form)fwMainWindow;
form.Activated -= fwMainWindow_Activated;
form.HandleDestroyed -= fwMainWindow_HandleDestroyed;
if (m_activeMainWindow == fwMainWindow)
m_activeMainWindow = null; // Just in case
if (m_rgMainWindows.Count == 0)
m_fwManager.ExecuteAsync(m_fwManager.ShutdownApp, this);
}
#endregion