The Unit type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| Unit(Double) |
Create a Unit from a value. The value is assumed to be in Points.
| |
| Unit(Double, UnitType) |
Create a Unit from a value and a UnitType
|
Methods
| Name | Description | |
|---|---|---|
| Equals |
Determines whether two Object instances are equal.
(Overrides ValueType..::..Equals(Object).) | |
| FromPixels |
Create a unit from pixels and a resolution. Useful for
working with images.
| |
| GetHashCode |
Calculates a hash for this type.
(Overrides ValueType..::..GetHashCode()()()().) | |
| Parse |
Create a unit from a string.
| |
| ToPoints |
Convert a unit string to points
| |
| ToString |
Returns the value of the Unit as a formatted string in points.
(Overrides ValueType..::..ToString()()()().) |
Operators
| Name | Description | |
|---|---|---|
| Equality |
Compares two Unit objects for equality.
| |
| ImplicitWideningImplicitImplicitImplicit(Double to Unit) |
Implicit conversion from double. This allows you to assign a double
to any variable or property of type Unit without constructors or casting.
| |
| ImplicitWideningImplicitImplicitImplicit(String to Unit) |
Implicit conversion from string. This allows you to assign a sized string
to any variable or property of type Unit without constructors or casting.
| |
| ImplicitWideningImplicitImplicitImplicit(Unit to Double) |
Implicit conversion to double. The value is expressed in points.
| |
| Inequality |
Compares two Unit objects for inequality.
|
Properties
| Name | Description | |
|---|---|---|
| IsRelative |
This Unit is a relative value. True if this Unit is a percentage.
| |
| Points |
Return the value of this Unit in points.
|