AngleSharp.Css by AngleSharp

<PackageReference Include="AngleSharp.Css" Version="1.0.0-alpha-109" />

.NET API 442,880 bytes

 Length

Represents an absolute length value.
public enum Unit

An enumeration of length units.

public static readonly Length Auto

Gets the auto value.

public static readonly Length Content

Gets the content value.

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 Normal

Gets the normal 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 string CssText { get; }

Gets the CSS text representation.

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 double Value { get; }

Gets the value of the length.

public Length(double value)

Creates a new length value in px.

public Length(double value, Unit unit)

Creates a new length value.

public static Unit GetUnit(string s)

Gets the unit from the enumeration for the provided string.

public static bool op_Equality(Length a, Length b)

Checks the equality of the two given lengths.

public static bool op_GreaterThan(Length a, Length b)

Compares the magnitude of two lengths.

public static bool op_GreaterThanOrEqual(Length a, Length b)

Compares the magnitude of two lengths.

public static bool op_Inequality(Length a, Length b)

Checks the inequality of the two given lengths.

public static bool op_LessThan(Length a, Length b)

Compares the magnitude of two lengths.

public static bool op_LessThanOrEqual(Length a, Length b)

Compares the magnitude of two lengths.

public static bool TryParse(string s, out Length result)

Tries to convert the given string to a Length.

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 double To(Unit unit, IRenderDimensions renderDimensions, RenderMode mode)

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

public double ToPixel(IRenderDimensions renderDimensions)

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

public double ToPixel(IRenderDimensions renderDimensions, RenderMode mode)

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