PdfSharp-GDI
1.31.7289
|
Represents a value and its unit of measure. The structure converts implicitly from and to double with a value measured in point. More...
Public Member Functions | |
XUnit (double point) | |
Initializes a new instance of the XUnit class with type set to point. More... | |
XUnit (double value, XGraphicsUnit type) | |
Initializes a new instance of the XUnit class. More... | |
string | ToString (IFormatProvider formatProvider) |
Returns the object as string using the format information. The unit of measure is appended to the end of the string. More... | |
string IFormattable. | ToString (string format, IFormatProvider formatProvider) |
Returns the object as string using the specified format and format information. The unit of measure is appended to the end of the string. More... | |
override string | ToString () |
Returns the object as string. The unit of measure is appended to the end of the string. More... | |
string | GetSuffix () |
Returns the unit of measure of the object as a string like 'pt', 'cm', or 'in'. More... | |
override bool | Equals (Object obj) |
Calls base class Equals. More... | |
override int | GetHashCode () |
Returns the hash code for this instance. More... | |
void | ConvertType (XGraphicsUnit type) |
Converts an existing object from one unit into another unit type. More... | |
Static Public Member Functions | |
static XUnit | FromPoint (double value) |
Returns an XUnit object. Sets type to point. More... | |
static XUnit | FromInch (double value) |
Returns an XUnit object. Sets type to inch. More... | |
static XUnit | FromMillimeter (double value) |
Returns an XUnit object. Sets type to millimeters. More... | |
static XUnit | FromCentimeter (double value) |
Returns an XUnit object. Sets type to centimeters. More... | |
static XUnit | FromPresentation (double value) |
Returns an XUnit object. Sets type to Presentation. More... | |
static implicit | operator XUnit (string value) |
Converts a string to an XUnit object. If the string contains a suffix like 'cm' or 'in' the object will be converted to the appropriate type, otherwise point is assumed. More... | |
static implicit | operator XUnit (int value) |
Converts an int to an XUnit object with type set to point. More... | |
static implicit | operator XUnit (double value) |
Converts a double to an XUnit object with type set to point. More... | |
static implicit | operator double (XUnit value) |
Returns a double value as point. More... | |
static bool | operator== (XUnit value1, XUnit value2) |
Memberwise comparison. To compare by value, use code like Math.Abs(a.Pt - b.Pt) < 1e5. More... | |
static bool | operator!= (XUnit value1, XUnit value2) |
Memberwise comparison. To compare by value, use code like Math.Abs(a.Pt - b.Pt) < 1e5. More... | |
static XUnit | Parse (string value) |
This member is intended to be used by XmlDomainObjectReader only. More... | |
Public Attributes | |
double | value |
XGraphicsUnit | type |
Static Public Attributes | |
static readonly XUnit | Zero |
Represents a unit with all values zero. More... | |
Properties | |
double | Value [get] |
Gets the raw value of the object without any conversion. To determine the XGraphicsUnit use property More... | |
XGraphicsUnit | Type [get] |
Gets the unit of measure. More... | |
double | Point [get, set] |
Gets or sets the value in point. More... | |
double | Inch [get, set] |
Gets or sets the value in inch. More... | |
double | Millimeter [get, set] |
Gets or sets the value in millimeter. More... | |
double | Centimeter [get, set] |
Gets or sets the value in centimeter. More... | |
double | Presentation [get, set] |
Gets or sets the value in presentation units (1/96 inch). More... | |
Represents a value and its unit of measure. The structure converts implicitly from and to double with a value measured in point.
PdfSharp.Drawing.XUnit.XUnit | ( | double | point | ) |
Initializes a new instance of the XUnit class with type set to point.
PdfSharp.Drawing.XUnit.XUnit | ( | double | value, |
XGraphicsUnit | type | ||
) |
Initializes a new instance of the XUnit class.
void PdfSharp.Drawing.XUnit.ConvertType | ( | XGraphicsUnit | type | ) |
Converts an existing object from one unit into another unit type.
override bool PdfSharp.Drawing.XUnit.Equals | ( | Object | obj | ) |
Calls base class Equals.
|
static |
Returns an XUnit object. Sets type to centimeters.
|
static |
Returns an XUnit object. Sets type to inch.
|
static |
Returns an XUnit object. Sets type to millimeters.
|
static |
Returns an XUnit object. Sets type to point.
|
static |
Returns an XUnit object. Sets type to Presentation.
override int PdfSharp.Drawing.XUnit.GetHashCode | ( | ) |
Returns the hash code for this instance.
string PdfSharp.Drawing.XUnit.GetSuffix | ( | ) |
Returns the unit of measure of the object as a string like 'pt', 'cm', or 'in'.
|
static |
Returns a double value as point.
|
static |
Converts a double to an XUnit object with type set to point.
|
static |
Converts an int to an XUnit object with type set to point.
|
static |
Converts a string to an XUnit object. If the string contains a suffix like 'cm' or 'in' the object will be converted to the appropriate type, otherwise point is assumed.
Memberwise comparison. To compare by value, use code like Math.Abs(a.Pt - b.Pt) < 1e5.
Memberwise comparison. To compare by value, use code like Math.Abs(a.Pt - b.Pt) < 1e5.
|
static |
This member is intended to be used by XmlDomainObjectReader only.
override string PdfSharp.Drawing.XUnit.ToString | ( | ) |
Returns the object as string. The unit of measure is appended to the end of the string.
string PdfSharp.Drawing.XUnit.ToString | ( | IFormatProvider | formatProvider | ) |
Returns the object as string using the format information. The unit of measure is appended to the end of the string.
string IFormattable. PdfSharp.Drawing.XUnit.ToString | ( | string | format, |
IFormatProvider | formatProvider | ||
) |
Returns the object as string using the specified format and format information. The unit of measure is appended to the end of the string.
XGraphicsUnit PdfSharp.Drawing.XUnit.type |
double PdfSharp.Drawing.XUnit.value |
|
static |
Represents a unit with all values zero.
|
getset |
Gets or sets the value in centimeter.
|
getset |
Gets or sets the value in inch.
|
getset |
Gets or sets the value in millimeter.
|
getset |
Gets or sets the value in point.
|
getset |
Gets or sets the value in presentation units (1/96 inch).
|
get |
Gets the unit of measure.
|
get |
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.