Table of Contents

Struct Thickness

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Thickness is a value type used to describe the thickness of frame around a rectangle. It contains four values each corresponding to a side: Left, Top, Right, Bottom.

public struct Thickness : IEquatable<Thickness>
Implements

Constructors

Thickness(double)

Initializes a new instance of the Thickness struct with the same value on every side.

Thickness(double, double)

Initializes a new instance of the Thickness structure with the specified values for the horizontal and vertical sides.

Thickness(double, double, double, double)

Initializes a new instance of the Thickness struct with the specified values for the each side.

Fields

Empty

Gets an empty Thickness object with Left, Top, Right, Bottom properties equal to zero.

NaN

Initializes a new instance of the Thickness structure with NaN in all bounds.

One

Gets an empty Thickness object with Left, Top, Right, Bottom properties equal to 1.

Properties

Bottom

This property is the length on the thickness' bottom side.

Horizontal

Gets the combined padding for the right and left edges.

IsAnyPositive

Returns whether any value on the side is positive (greater than 0).

IsPositive

Returns whether all values on every side are positive (greater than 0).

IsUniform

Returns whether all values on every side are equal.

Left

This property is the length on the thickness' left side.

LeftTop

Gets Left and Top as SizeD.

Right

This property is the Length on the thickness' right side.

RightBottom

Gets Right and Bottom as SizeD.

Size

Gets the combined padding information in the form of a SizeD.

Top

This property is the length on the thickness' top side.

Vertical

Gets the combined padding for the top and bottom edges.

Methods

ApplyMin(Thickness)

Apply minimal limits to all the fields of the Thickness instance.

ApplyMinMax(double, double)

Apply minimal and maximal limits to all the fields of the Thickness instance.

Equals(Thickness)

Compares this instance of Thickness with another instance.

Equals(object?)

This function compares to the provided object for type and value equality.

FromArray(float[]?)

Creates Thickness from array of 1, 2 or 4 values.

GetHashCode()

Serves as the default hash function.

GetSize(bool)

Gets Vertical or Horizontal depending on the isVert parameter value.

Inflate(double)

Inflate all fields of the Thickness instance on the same value.

Parse(string)

Parses a Thickness string.

Reset(bool)

Sets all fields to 0 if reset is True.

ToString()

Converts this Thickness object to a string.

TryParse(string, out Thickness)

Parses a Thickness string.

WithBottom(double)

Gets a copy of this object with changed Bottom property.

WithLeft(double)

Gets a copy of this object with changed Left property.

WithRight(double)

Gets a copy of this object with changed Right property.

WithTop(double)

Gets a copy of this object with changed Top property.

Operators

operator ==(Thickness, Thickness)

Overloaded operator to compare two Thicknesses for equality.

implicit operator Thickness(double)

Implicit operator convertion from a single value to Thickness. All fields of thickness instance are assigned with the same value.

implicit operator Thickness(int)

Implicit operator convertion from int to Thickness. All fields of thickness instance are assigned with the same int value.

implicit operator Thickness((double, double, double, double))

Implicit operator convertion from tuple with four values to Thickness.

operator !=(Thickness, Thickness)

Overloaded operator to compare two Thicknesses for inequality.