Struct Rect
Definition
- Namespace:
- ElmSharp
- Assembly:
- ElmSharp.dll
- API Level:
- preview
The Rect is a struct that represents the rectangular space.
public struct Rect : IEquatable<Rect>
- Implements
Constructors
View SourceRect(Int32, Int32, Int32, Int32)
Creates and initializes a new instance of the Rect class.
Declaration
public Rect(int x, int y, int w, int h)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | X-axis value. |
Int32 | y | Y-axis value. |
Int32 | w | Width value. |
Int32 | h | Height value. |
API Level: preview
Properties
View SourceBottom
Gets the extent along the Y-axis.
Declaration
public int Bottom { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceHeight
Gets or sets the height of this rectangle.
Declaration
public int Height { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceLeft
Gets the position of this rectangle on the X-axis.
Declaration
public int Left { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceLocation
Gets the point defined by Rectangle.Left and Rectangle.Top.
Declaration
public Point Location { get; }
Property Value
Type | Description |
---|---|
Point |
API Level: preview
View SourceRight
Gets the extent along the X-axis.
Declaration
public int Right { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceSize
Gets the extent of the rectangle along its X-axis and Y-axis.
Declaration
public Size Size { get; }
Property Value
Type | Description |
---|---|
Size |
API Level: preview
View SourceTop
Gets the position of this rectangle on the Y-axis.
Declaration
public int Top { get; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceWidth
Gets or sets the width of this rectangle.
Declaration
public int Width { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceX
Gets or sets the position of this rectangle on the X-axis.
Declaration
public int X { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
View SourceY
Gets or sets the position of this rectangle on the Y-axis.
Declaration
public int Y { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
API Level: preview
Methods
View SourceEquals(Rect)
Indicates whether this instance and a Rect object are equal.
Declaration
public bool Equals(Rect other)
Parameters
Type | Name | Description |
---|---|---|
Rect | other | The Rect to compare with the current instance. |
Returns
Type | Description |
---|---|
Boolean | true if the object and this instance are of the same type and represent the same value, otherwise, false |
API Level: preview
View SourceEquals(Object)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare with the current instance. |
Returns
Type | Description |
---|---|
Boolean | true if the object and this instance are of the same type and represent the same value, otherwise false. |
Overrides
API Level: preview
View SourceGetHashCode()
Gets the hash code.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | The hash code. |
Overrides
API Level: preview
View SourceToString()
A human-readable representation of Rect.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The string is formatted as "{{X={0} Y={1} Width={2} Height={3}}}". |
Overrides
API Level: preview
Operators
View SourceEquality(Rect, Rect)
Whether both Rect's are equal.
Declaration
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 |
---|---|
Boolean | True if both Rect's have equal values. |
API Level: preview
View SourceInequality(Rect, Rect)
Whether both Rect's are not equal.
Declaration
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 |
---|---|
Boolean | True if both Rect's do not have equal values. |