C# Class SilverFlow.Controls.Controllers.SnapinController

Provides helpers methods for calculating window position during movement and resizing.
Inheritance: ISnapinController
Afficher le fichier Open project: Zoomicon/ZUI

Private Properties

Свойство Type Description
DistanceBetweenBottomEdgeAndRectangle double
DistanceBetweenLeftEdgeAndRectangle double
DistanceBetweenRectangles Distance
DistanceBetweenRightEdgeAndRectangle double
DistanceBetweenTopEdgeAndRectangle double

Méthodes publiques

Méthode Description
SnapBottomLeftCorner ( Rect rect ) : Point

Snaps the lower left corner of the specified rectangle to the nearest bounds.

SnapBottomRightCorner ( Rect rect ) : Point

Snaps the bottom right corner of the specified rectangle to the nearest bounds.

SnapRectangle ( Rect rect ) : Point

Returns new position of the specified rectangle taking into account bounds the rectangle can be attracted to.

SnapTopLeftCorner ( Rect rect ) : Point

Snaps the upper left corner of the specified rectangle to the nearest bounds.

SnapTopRightCorner ( Rect rect ) : Point

Snaps the upper right corner of the specified rectangle to the nearest bounds.

Private Methods

Méthode Description
DistanceBetweenBottomEdgeAndRectangle ( Rect first, Rect second ) : double

Returns distance between the bottom edge of the rectangle and another rectangle.

DistanceBetweenLeftEdgeAndRectangle ( Rect first, Rect second ) : double

Returns distance between the left edge of the rectangle and another rectangle.

DistanceBetweenRectangles ( Rect first, Rect second ) : Distance

Returns mininal distance between two rectangles.

DistanceBetweenRightEdgeAndRectangle ( Rect first, Rect second ) : double

Returns distance between the right edge of the rectangle and another rectangle.

DistanceBetweenTopEdgeAndRectangle ( Rect first, Rect second ) : double

Returns distance between the top edge of the rectangle and another rectangle.

Method Details

SnapBottomLeftCorner() public méthode

Snaps the lower left corner of the specified rectangle to the nearest bounds.
public SnapBottomLeftCorner ( Rect rect ) : Point
rect System.Windows.Rect The rectangle.
Résultat System.Windows.Point

SnapBottomRightCorner() public méthode

Snaps the bottom right corner of the specified rectangle to the nearest bounds.
public SnapBottomRightCorner ( Rect rect ) : Point
rect System.Windows.Rect The rectangle.
Résultat System.Windows.Point

SnapRectangle() public méthode

Returns new position of the specified rectangle taking into account bounds the rectangle can be attracted to.
public SnapRectangle ( Rect rect ) : Point
rect System.Windows.Rect The rectangle.
Résultat System.Windows.Point

SnapTopLeftCorner() public méthode

Snaps the upper left corner of the specified rectangle to the nearest bounds.
public SnapTopLeftCorner ( Rect rect ) : Point
rect System.Windows.Rect The rectangle.
Résultat System.Windows.Point

SnapTopRightCorner() public méthode

Snaps the upper right corner of the specified rectangle to the nearest bounds.
public SnapTopRightCorner ( Rect rect ) : Point
rect System.Windows.Rect The rectangle.
Résultat System.Windows.Point