Пример #1
0
        public void RefreshWindows(WindowManagerEventArgs args)
        {
            // update screens of stale windows
            if (!EnableService)
            {
                return;
            }

            if (EnableMultiMon)
            {
                foreach (Screen screen in _windowManager.ScreenState)
                {
                    CairoAppBarWindow window = WindowManager.GetScreenWindow(Windows, screen);

                    if (window != null)
                    {
                        window.Screen = screen;
                        window.SetScreenPosition();
                    }
                }
            }
            else if (Windows.Count > 0)
            {
                Windows[0].Screen = Screen.PrimaryScreen;
                Windows[0].SetScreenPosition();
            }
        }
Пример #2
0
 protected void CloseWindow(CairoAppBarWindow window)
 {
     if (!window.IsClosing)
     {
         window.AllowClose = true;
         window.Close();
     }
 }
Пример #3
0
        protected void CloseScreenWindow(string screenDeviceName)
        {
            CairoAppBarWindow windowToClose = null;

            foreach (var window in Windows)
            {
                if (window.Screen != null && window.Screen.DeviceName == screenDeviceName)
                {
                    windowToClose = window;
                    break;
                }
            }

            if (windowToClose != null)
            {
                CloseWindow(windowToClose);

                Windows.Remove(windowToClose);
            }
        }