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 Object → ValueType → XUnit
Implements IFormattable
Represents a unit with all values zero.
public static XUnit Zero;
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; }
Gets the unit of measure.
public XGraphicsUnit Type { get; private set; }
Gets or sets the value in point.
public double Point { get; set; }
Gets or sets the value in inch.
public double Inch { get; set; }
Gets or sets the value in millimeter.
public double Millimeter { get; set; }
Gets or sets the value in centimeter.
public double Centimeter { get; set; }
Gets or sets the value in presentation units (1/96 inch).
public double Presentation { get; set; }
Initializes a new instance of the XUnit class with type set to point.
XUnit(double point)
point
Double
Initializes a new instance of the XUnit class.
XUnit(double value, XGraphicsUnit type)
value
Double
type
XGraphicsUnit
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)
formatProvider
IFormatProvider
Returns the object as string. The unit of measure is appended to the end of the string.
string ToString()
Returns an XUnit object. Sets type to point.
XUnit FromPoint(double value)
value
Double
Returns an XUnit object. Sets type to inch.
XUnit FromInch(double value)
value
Double
Returns an XUnit object. Sets type to millimeters.
XUnit FromMillimeter(double value)
value
Double
Returns an XUnit object. Sets type to centimeters.
XUnit FromCentimeter(double value)
value
Double
Returns an XUnit object. Sets type to Presentation.
XUnit FromPresentation(double value)
value
Double
Calls base class Equals.
bool Equals(object obj)
obj
Object
Returns the hash code for this instance.
int GetHashCode()
This member is intended to be used by XmlDomainObjectReader only.
XUnit Parse(string value)
value
String
Converts an existing object from one unit into another unit type.
void ConvertType(XGraphicsUnit type)
type
XGraphicsUnit