The Unit type exposes the following members.

Constructors

  NameDescription
Public methodUnit(Double)
Create a Unit from a value. The value is assumed to be in Points.
Public methodUnit(Double, UnitType)
Create a Unit from a value and a UnitType

Methods

  NameDescription
Public methodEquals
Determines whether two Object instances are equal.
(Overrides ValueType..::..Equals(Object).)
Public methodStatic memberFromPixels
Create a unit from pixels and a resolution. Useful for working with images.
Public methodGetHashCode
Calculates a hash for this type.
(Overrides ValueType..::..GetHashCode()()()().)
Public methodStatic memberParse
Create a unit from a string.
Public methodStatic memberToPoints
Convert a unit string to points
Public methodToString
Returns the value of the Unit as a formatted string in points.
(Overrides ValueType..::..ToString()()()().)

Operators

  NameDescription
Public operatorStatic memberEquality
Compares two Unit objects for equality.
Public operatorStatic memberImplicitWideningImplicitImplicitImplicit(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.
Public operatorStatic memberImplicitWideningImplicitImplicitImplicit(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.
Public operatorStatic memberImplicitWideningImplicitImplicitImplicit(Unit to Double)
Implicit conversion to double. The value is expressed in points.
Public operatorStatic memberInequality
Compares two Unit objects for inequality.

Properties

  NameDescription
Public propertyIsRelative
This Unit is a relative value. True if this Unit is a percentage.
Public propertyPoints
Return the value of this Unit in points.

See Also