AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.3" />

.NET API 1,189,376 bytes

 Length

Represents an absolute length value.
public enum Unit

An enumeration of length units.

public static readonly Length Full

Gets the full relative length, i.e. 100%.

public static readonly Length Half

Gets the half relative length, i.e. 50%.

public static readonly Length Medium

Gets a medium length value.

public static readonly Length Missing

Gets the missing value.

public static readonly Length Thick

Gets a thick length value.

public static readonly Length Thin

Gets a thin length value.

public static readonly Length Zero

Gets a zero pixel length value.

public bool IsAbsolute { get; }

Gets if the length is given in absolute units. Such a length may be converted to pixels.

public bool IsRelative { get; }

Gets if the length is given in relative units. Such a length cannot be converted to pixels.

public Unit Type { get; }

Gets the type of the length.

public string UnitString { get; }

Gets the representation of the unit as a string.

public float Value { get; }

Gets the value of the length.

public Length(float value, Unit unit)

Creates a new length value.

public static bool op_Equality(Length a, Length b)

Checks the equality of the two given lengths.

public static bool op_Inequality(Length a, Length b)

Checks the inequality of the two given lengths.

public int CompareTo(Length other)

Compares the current length against the given one.

public bool Equals(Length other)

Checks if both lengths are actually equal.

public float To(Unit unit)

Converts the length to the given unit, if possible. If the current or given unit is relative, then an exception will be thrown.

public float ToPixel()

Converts the length to a number of pixels, if possible. If the current unit is relative, then an exception will be thrown.

public string ToString(string format, IFormatProvider formatProvider)

Returns a formatted string representing the length.