[]
Represents a length measurement with units.
public struct Length : IComparable
Name | Description |
---|---|
Length(double, Unit) | Initializes a new instance of the Length struct using a specified length and unit. |
Length(string) | Initializes a new instance of the Length struct using a specified string length. |
Name | Description |
---|---|
Empty | An empty Length with no value. |
Zero | A Length value representing zero inches. |
Name | Description |
---|---|
IsUndefined | Gets a value indicating whether the Length is undefined. |
IsValid | Gets a value indicating whether the Length is valid. |
IsZero | Gets a value indicating whether the length is valid and equals zero. |
OriginalUnit | Gets an original unit type that was specified for this Length. |
Name | Description |
---|---|
Add(Length, Length) | Adds two Length values and returns the result in the unit of the first length. |
CompareTo(Length) | Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. |
CompareTo(object) | Compares the current Length instance to a specified object and returns an indication of their relative values. |
Divide(Length, Length) | Divides one Length value by another. |
DivideBy(Length, float) | Divides a Length value using a specified value. |
Equals(Length) | Indicates whether the current object is equal to another object of the same type. |
Equals(object) | Determines whether the specified object is equal to the current Length. |
FromTwips(float, Unit) | Creates a new Length from a specified value in twips. |
GetHashCode() | Serves as a hash function for the Length. |
Multiply(Length, float) | Multiplies a specified Length value using a scale factor. |
Subtract(Length, Length) | Subtracts one Length value from another and returns the result in the unit of the first length. |
ToCentimeters() | Converts the Length value to centimeters (1cm = 567twips). |
ToInches() | Converts the Length value to inches (1in = 1440twips). |
ToMillimeters() | Converts the Length value to millimeters (1mm = 56.7twips). |
ToPica() | Converts the Length value to picas (1pc = 240twips). |
ToPoints() | Converts the existing Length twips to points (1pt = 20twips) |
ToString() | Converts the value of this instance to its equivalent string representation. |
ToString(IFormatProvider) | Converts the value of this instance to its equivalent string representation using the specified format. |
ToTwips() | Converts the Length value to twips. |
TryParse(string, out Length) | Attempts to parse a string as a Length value. |
TwipsToString(float, Unit) | Converts a value in twips to a string representation in the specified unit. |
Name | Description |
---|---|
operator +(Length, Length) | Adds two Length values and returns the result in the unit of the first length. |
operator ==(Length, Length) | Determines if two Length value values are equal. |
explicit operator string(Length) | Converts a Length instance to its string representation. |
operator >(Length, Length) | Determines if the first Length value is greater than the second. |
operator >=(Length, Length) | Determines if the first Length value is greater than or equal to the second. |
implicit operator Length(string) | Converts a string to a Length instance. |
operator !=(Length, Length) | Determines if two Length values are not equal. |
operator <(Length, Length) | Determines if the first Length value is less than the second. |
operator <=(Length, Length) | Determines if the first Length value is less than or equal to the second. |
operator -(Length, Length) | Subtracts one Length value from another and returns the result in the unit of the first length. |
operator -(Length) | Inverts a specified Length value. |