PDFsharp-net6

XUnit

Namespace: PdfSharp.Drawing

Represents a value and its unit of measure. The structure converts implicitly from and to double with a value measured in point.

public struct XUnit

Inheritance ObjectValueTypeXUnit
Implements IFormattable

Fields

Zero

Represents a unit with all values zero.

public static XUnit Zero;

Properties

Value

Gets the raw value of the object without any conversion. To determine the XGraphicsUnit use property

Type

. To get the value in point use the implicit conversion to double.

public double Value { get; private set; }

Property Value

Double

Type

Gets the unit of measure.

public XGraphicsUnit Type { get; private set; }

Property Value

XGraphicsUnit

Point

Gets or sets the value in point.

public double Point { get; set; }

Property Value

Double

Inch

Gets or sets the value in inch.

public double Inch { get; set; }

Property Value

Double

Millimeter

Gets or sets the value in millimeter.

public double Millimeter { get; set; }

Property Value

Double

Centimeter

Gets or sets the value in centimeter.

public double Centimeter { get; set; }

Property Value

Double

Presentation

Gets or sets the value in presentation units (1/96 inch).

public double Presentation { get; set; }

Property Value

Double

Constructors

XUnit(Double)

Initializes a new instance of the XUnit class with type set to point.

XUnit(double point)

Parameters

point Double

XUnit(Double, XGraphicsUnit)

Initializes a new instance of the XUnit class.

XUnit(double value, XGraphicsUnit type)

Parameters

value Double

type XGraphicsUnit

Methods

ToString(IFormatProvider)

Returns the object as string using the format information. The unit of measure is appended to the end of the string.

string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

Returns

String

ToString()

Returns the object as string. The unit of measure is appended to the end of the string.

string ToString()

Returns

String

FromPoint(Double)

Returns an XUnit object. Sets type to point.

XUnit FromPoint(double value)

Parameters

value Double

Returns

XUnit

FromInch(Double)

Returns an XUnit object. Sets type to inch.

XUnit FromInch(double value)

Parameters

value Double

Returns

XUnit

FromMillimeter(Double)

Returns an XUnit object. Sets type to millimeters.

XUnit FromMillimeter(double value)

Parameters

value Double

Returns

XUnit

FromCentimeter(Double)

Returns an XUnit object. Sets type to centimeters.

XUnit FromCentimeter(double value)

Parameters

value Double

Returns

XUnit

FromPresentation(Double)

Returns an XUnit object. Sets type to Presentation.

XUnit FromPresentation(double value)

Parameters

value Double

Returns

XUnit

Equals(Object)

Calls base class Equals.

bool Equals(object obj)

Parameters

obj Object

Returns

Boolean

GetHashCode()

Returns the hash code for this instance.

int GetHashCode()

Returns

Int32

Parse(String)

This member is intended to be used by XmlDomainObjectReader only.

XUnit Parse(string value)

Parameters

value String

Returns

XUnit

ConvertType(XGraphicsUnit)

Converts an existing object from one unit into another unit type.

void ConvertType(XGraphicsUnit type)

Parameters

type XGraphicsUnit