protected void AddWindow(IApplicationWindowEx window)
 {
     lock (_lock)
     {
         _windows.Add(window);
     }
 }
        public void RemoveApplicationWindow(IApplicationWindowEx applicationWindow)
        {
            if (applicationWindow == null)
            {
                Logger.Error("Unable to remove window because applicationWindow is null");
                throw new ArgumentNullException("applicationWindow");
            }

            lock (_lock)
            {
                _windows.Remove(applicationWindow);
            }
            if (_windows.Count == 0)
            {
                NoWindowsOpen.Raise(this, EventArgs.Empty);
            }

            Logger.Debug("Application window with ID {0} removed.", applicationWindow.GetId());
        }
 public void ShowApplicationWindowPopup(IApplicationWindowEx applicationWindow, ShowPopupEventArgs eventArgs)
 {
     CreateWindowInternal(eventArgs, request => request.RequestId == eventArgs.PopupBrowser.BrowserName);
     Logger.Debug("Application window with ID {0} shown.", applicationWindow.GetId());
 }