Design Pattern Examples
Overview of object-oriented design patterns
WindowRectangle Class Reference

Represents a rectangular region, with upper left and lower right coordinates. More...

Collaboration diagram for WindowRectangle:
Collaboration graph

Public Member Functions

 WindowRectangle (int x, int y, int width, int height)
 Constructor.
 
bool PointInside (MessagePosition point)
 Determine if the given point is in the rectangle.
 
override string ToString ()
 Convert this rectangle to a string.
 

Public Attributes

int Left
 
int Top
 
int Right
 
int Bottom
 

Static Private Attributes

const int MINIMUM_WIDTH = 4
 
const int MINIMUM_HEIGHT = 4
 

Detailed Description

Represents a rectangular region, with upper left and lower right coordinates.

For this example, the minimum width of a rectangle is 4 x 4.

Definition at line 18 of file HandlerChain_MessageWindow_Class.cs.

Constructor & Destructor Documentation

◆ WindowRectangle()

WindowRectangle ( int  x,
int  y,
int  width,
int  height 
)
inline

Constructor.

Parameters
xX coordinate of upper left corner.
yY coordinate of upper left corner.
widthWidth of rectangle.
heightHeight of rectangle.

Definition at line 35 of file HandlerChain_MessageWindow_Class.cs.

References WindowRectangle.Bottom, WindowRectangle.Left, WindowRectangle.MINIMUM_HEIGHT, WindowRectangle.MINIMUM_WIDTH, WindowRectangle.Right, and WindowRectangle.Top.

Member Function Documentation

◆ PointInside()

bool PointInside ( MessagePosition  point)
inline

Determine if the given point is in the rectangle.

Parameters
pointPoint to examine.
Returns
Return true if the point is in the rectangle.

Definition at line 56 of file HandlerChain_MessageWindow_Class.cs.

References WindowRectangle.Bottom, WindowRectangle.Left, WindowRectangle.Right, WindowRectangle.Top, MessagePosition.X, and MessagePosition.Y.

Referenced by MessageWindow._PointInCloseBox(), and MessageWindow._PointInWindow().

◆ ToString()

override string ToString ( )
inline

Convert this rectangle to a string.

Returns
Returns a representation of this rectangle.

Definition at line 73 of file HandlerChain_MessageWindow_Class.cs.

References WindowRectangle.Bottom, WindowRectangle.Left, WindowRectangle.Right, and WindowRectangle.Top.

Member Data Documentation

◆ Bottom

◆ Left

◆ MINIMUM_HEIGHT

const int MINIMUM_HEIGHT = 4
staticprivate

Definition at line 21 of file HandlerChain_MessageWindow_Class.cs.

Referenced by WindowRectangle.WindowRectangle().

◆ MINIMUM_WIDTH

const int MINIMUM_WIDTH = 4
staticprivate

Definition at line 20 of file HandlerChain_MessageWindow_Class.cs.

Referenced by WindowRectangle.WindowRectangle().

◆ Right

◆ Top


The documentation for this class was generated from the following file: