/// <summary> /// Unpin the given window from all desktops. /// </summary> /// <param name="handle">The handle of the window to unpin.</param> public void UnpinWindow(IntPtr handle) { DesktopManager.UnpinWindow(handle); }
/// <summary> /// Moves to the given desktop. /// </summary> /// <param name="point">The point in the grid to go to.</param> public void GoTo(Point point) { DesktopManager.GoTo(PointToIndex(point)); }
/// <summary> /// Get the current desktop's position in the matrix/grid. /// </summary> /// <returns>The point corresponding to the current desktop.</returns> public Point GetCurrentPosition() { return(IndexToPoint(DesktopManager.CurrentDesktop())); }
/// <summary> /// Moves to the given desktop with the current foreground window. /// </summary> /// <param name="point">The point in the grid to go to.</param> private void MoveForegroundWindowTo(Point point) { DesktopManager.MoveForegroundWindowToDesktop(PointToIndex(point)); GoTo(point); }
/// <summary> /// Captures/stores the current foreground window's reference for future use. /// </summary> public void CaptureForegroundWindow() { CapturedView = DesktopManager.GetForegroundView(); }
/// <summary> /// Moves to the given desktop with the captured window. /// </summary> /// <param name="point">The point in the grid to go to.</param> private void MoveCapturedWindowTo(Point point) { DesktopManager.MoveViewToDesktop(CapturedView, PointToIndex(point)); GoTo(point); }
/// <summary> /// Create a desktop matrix by defining the size of the matrix and creating/removing any necessary desktops. /// </summary> /// <param name="rows">The height of the matrix.</param> /// <param name="columns">The width of the matrix.</param> public DesktopMatrix(int rows, int columns) { Rows = rows; Columns = columns; DesktopManager.MatchCount(Rows * Columns); }