Table of Contents

Class Rectangle<T>

Namespace
Whim
Assembly
Whim.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public record Rectangle<T> : IRectangle<T>, IPoint<T>, IEquatable<Rectangle<T>> where T : INumber<T>

Type Parameters

T
Inheritance
Rectangle<T>
Implements
Inherited Members
Extension Methods

Constructors

Rectangle()

Creates a new Rectangle<T> with zero values.
public Rectangle()

Rectangle(IRectangle<T>)

Creates a new Rectangle<T> with the given values.
public Rectangle(IRectangle<T> rectangle)

Parameters

rectangle IRectangle<T>

Rectangle(T, T, T, T)

Creates a new Rectangle<T> with the given values.
public Rectangle(T x, T y, T width, T height)

Parameters

x T
y T
width T
height T

Properties

Center

The center of the rectangle.
public IPoint<T> Center { get; }

Property Value

IPoint<T>

Height

The height, in pixels.
public T Height { get; set; }

Property Value

T

Width

The width, in pixels.
public T Width { get; set; }

Property Value

T

X

The x-coordinate of the left of the item.
public T X { get; set; }

Property Value

T

Y

The y-coordinate of the top of the item.
public T Y { get; set; }

Property Value

T

Methods

ContainsPoint(IPoint<T>)

Indicates whether the specified point is inside this item's bounding box.
public bool ContainsPoint(IPoint<T> point)

Parameters

point IPoint<T>
The point to check.

Returns

bool
true if the location given by point is inside this IRectangle<T>'s bounding box; otherwise, false.

GetHashCode()

Serves as the default hash function.
public override int GetHashCode()

Returns

int
A hash code for the current object.

ToString()

Returns a string that represents the current object.
public override string ToString()

Returns

string
A string that represents the current object.