Struct Rect

Definition

Namespace:
ElmSharp
Assembly:
ElmSharp.dll
API Level:
preview

The Rect is a struct that represents the rectangular space.

C#
Copy
public struct Rect : IEquatable<Rect>
Implements
System.IEquatable<Rect>

Constructors

View Source

Rect(Int32, Int32, Int32, Int32)

Creates and initializes a new instance of the Rect class.

Declaration
C#
Copy
public Rect(int x, int y, int w, int h)
Parameters
Type Name Description
System.Int32 x

X-axis value.

System.Int32 y

Y-axis value.

System.Int32 w

Width value.

System.Int32 h

Height value.

API Level: preview

Properties

View Source

Bottom

Gets the extent along the Y-axis.

Declaration
C#
Copy
public int Bottom { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Height

Gets or sets the height of this rectangle.

Declaration
C#
Copy
public int Height { get; set; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Left

Gets the position of this rectangle on the X-axis.

Declaration
C#
Copy
public int Left { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Location

Gets the point defined by Rectangle.Left and Rectangle.Top.

Declaration
C#
Copy
public Point Location { get; }
Property Value
Type Description
Point
API Level: preview
View Source

Right

Gets the extent along the X-axis.

Declaration
C#
Copy
public int Right { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Size

Gets the extent of the rectangle along its X-axis and Y-axis.

Declaration
C#
Copy
public Size Size { get; }
Property Value
Type Description
Size
API Level: preview
View Source

Top

Gets the position of this rectangle on the Y-axis.

Declaration
C#
Copy
public int Top { get; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Width

Gets or sets the width of this rectangle.

Declaration
C#
Copy
public int Width { get; set; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

X

Gets or sets the position of this rectangle on the X-axis.

Declaration
C#
Copy
public int X { get; set; }
Property Value
Type Description
System.Int32
API Level: preview
View Source

Y

Gets or sets the position of this rectangle on the Y-axis.

Declaration
C#
Copy
public int Y { get; set; }
Property Value
Type Description
System.Int32
API Level: preview

Methods

View Source

Equals(Rect)

Indicates whether this instance and a Rect object are equal.

Declaration
C#
Copy
public bool Equals(Rect other)
Parameters
Type Name Description
Rect other

The Rect to compare with the current instance.

Returns
Type Description
System.Boolean

true if the object and this instance are of the same type and represent the same value, otherwise, false

API Level: preview
View Source

Equals(Object)

Indicates whether this instance and a specified object are equal.

Declaration
C#
Copy
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The object to compare with the current instance.

Returns
Type Description
System.Boolean

true if the object and this instance are of the same type and represent the same value, otherwise false.

Overrides
System.ValueType.Equals(System.Object)
API Level: preview
View Source

GetHashCode()

Gets the hash code.

Declaration
C#
Copy
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code.

Overrides
System.ValueType.GetHashCode()
API Level: preview
View Source

ToString()

A human-readable representation of Rect.

Declaration
C#
Copy
public override string ToString()
Returns
Type Description
System.String

The string is formatted as "{{X={0} Y={1} Width={2} Height={3}}}".

Overrides
System.ValueType.ToString()
API Level: preview

Operators

View Source

Equality(Rect, Rect)

Whether both Rect's are equal.

Declaration
C#
Copy
public static bool operator ==(Rect r1, Rect r2)
Parameters
Type Name Description
Rect r1

A Rect on the left hand side.

Rect r2

A Rect on the right hand side.

Returns
Type Description
System.Boolean

True if both Rect's have equal values.

API Level: preview
View Source

Inequality(Rect, Rect)

Whether both Rect's are not equal.

Declaration
C#
Copy
public static bool operator !=(Rect r1, Rect r2)
Parameters
Type Name Description
Rect r1

A Rect on the left hand side.

Rect r2

A Rect on the right hand side.

Returns
Type Description
System.Boolean

True if both Rect's do not have equal values.

API Level: preview

Implements

System.IEquatable<T>