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(); } }
protected void CloseWindow(CairoAppBarWindow window) { if (!window.IsClosing) { window.AllowClose = true; window.Close(); } }
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); } }