public class Rectangle
{
private Point _bottomLeft = Point.Empty;
private Point _topRight = Point.Empty;
public Point BottomLeft
{
get
{
return this._bottomLeft;
}
set
{
this._bottomLeft = value;
}
}
public Point TopRight
{
get
{
return this._topRight;
}
set
{
this._topRight = value;
}
}
public int GetArea()
{
if (this._bottomLeft == this._topRight)
{
return 0;
}
int width = this._topRight.X - this._bottomLeft.X;
int heigth = this._bottomLeft.Y - this._topRight.Y;
return width * heigth;
}