PaddingF

References
[TypeConverter(PaddingFConverterInternal)] public struct PaddingF : IEquatable<PaddingF>
Represents an amount of padding to apply to an object at the top, left, right, and bottom.

Constructors

PaddingF

#
public PaddingF(float all)
Initializes a new instance of the Padding class with the specified padding for all sides

PaddingF

#
public PaddingF(float horizontal, float vertical)
Initializes a new instance of the Padding class with the specified padding for horizontal and vertical sides
horizontal (float)Amount of padding to set the Left and Right sides
vertical (float)Amount of padding to set the Top and Bottom sides

PaddingF

#
public PaddingF(float left, float top, float right, float bottom)
Initializes a new instance of the Padding class
left (float)Amount of padding to apply to the left
top (float)Amount of padding to apply to the top
right (float)Amount of padding to apply to the right
bottom (float)Amount of padding to apply to the bottom

Fields

Empty

#
public static readonly PaddingF Empty
Gets an empty padding with zero for each side

Properties

Horizontal

#
public float Horizontal { get; }
Gets the total horizontal padding, which is the sum of Left and Right.

IsZero

#
public bool IsZero { get; }
Gets a value indicating that all sides of the padding are zero

Size

#
public SizeF Size { get; }
Gets the padding as a size value with the Horizontal and Vertical values as the Size.Width and Size.Height, respectively.

Vertical

#
public float Vertical { get; }
Gets the total vertical padding, which is the sum of Top and Bottom

Methods

Equals

#
public override bool Equals(object obj)
Determines the equality between this instance and the specified object
obj (object)Object to compare to
True if obj is a Padding object and is equal to this instance, false if not
ValueType.Equals

Equals

#
public bool Equals(PaddingF other)
Determines equality between this instance and the specified padding
other (PaddingF)Other padding instance to compare with
True if the specified padding is equal to this instance, false if not

GetHashCode

#
public override int GetHashCode()
Gets the hash code for this Padding instance

ToString

#
public override string ToString()
Converts this object to a string

Operators

OperationResultDescription
PaddingF+PaddingFPaddingFAdds two padding values together
PaddingF==PaddingFboolDetermines the equality of two padding objects
PaddingF!=PaddingFboolDetermines the inequality of two padding objects
PaddingF-PaddingFPaddingFSubtracts a padding value from another value
-PaddingFPaddingFReturns a new Padding with negative left, top, right, and bottom values

Convertors

OperationResultDescription
implicitfloatPaddingFImplicitly converts a single integer to a padding with all sides of equal value.
implicitPaddingPaddingFConverts an integral padding to floading precision padding.