Struct Size

Definition

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

The Size is a struct defining the height and width as a pair of generic type.

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

Constructors

View Source

Size(Int32, Int32)

Initializes a new instance of the size structure from specified dimensions.

Declaration
C#
Copy
public Size(int width, int height)
Parameters
Type Name Description
System.Int32 width

The width to set.

System.Int32 height

The height to set.

API Level: preview

Fields

View Source

Height

Magnitude along the vertical axis, in platform-specific units.

Declaration
C#
Copy
public int Height
Field Value
Type Description
System.Int32
API Level: preview
View Source

Width

Magnitude along the horizontal axis, in platform-defined units.

Declaration
C#
Copy
public int Width
Field Value
Type Description
System.Int32
API Level: preview

Methods

View Source

Equals(Size)

Indicates whether this instance and a Size object are equal.

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

The Size 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 Size.

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

The string is formatted as "{{Width={0} Height={1}}}".

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

Operators

View Source

Equality(Size, Size)

Whether both Sizes are equal.

Declaration
C#
Copy
public static bool operator ==(Size s1, Size s2)
Parameters
Type Name Description
Size s1

A Size on the left hand side.

Size s2

A Size on the right hand side.

Returns
Type Description
System.Boolean

True if both Sizes have equal values.

API Level: preview
View Source

Inequality(Size, Size)

Whether both Sizes are not equal.

Declaration
C#
Copy
public static bool operator !=(Size s1, Size s2)
Parameters
Type Name Description
Size s1

A Size on the left hand side.

Size s2

A Size on the right hand side.

Returns
Type Description
System.Boolean

True if both Sizes do not have equal values.

API Level: preview

Implements

System.IEquatable<T>