Struct Length
Reprensents a distance value.
Syntax
public struct Length : IEquatable<Length>
Constructors
Length(Single)
Declaration
public Length(float value)
Parameters
Type |
Name |
Description |
Single |
value |
|
Length(Single, LengthUnit)
Declaration
public Length(float value, LengthUnit unit)
Parameters
Properties
unit
The unit of the value property.
Declaration
public LengthUnit unit { get; set; }
Property Value
value
Declaration
public float value { get; set; }
Property Value
Methods
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Equals(Length)
Declaration
public bool Equals(Length other)
Parameters
Type |
Name |
Description |
Length |
other |
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Percent(Single)
Creates a percentage Length from a float.
Declaration
public static Length Percent(float value)
Parameters
Type |
Name |
Description |
Single |
value |
|
Returns
Type |
Description |
Length |
The created length.
|
ToString()
Declaration
public override string ToString()
Returns
Operators
Equality(Length, Length)
Declaration
public static bool operator ==(Length lhs, Length rhs)
Parameters
Returns
Implicit(Single to Length)
Declaration
public static implicit operator Length(float value)
Parameters
Type |
Name |
Description |
Single |
value |
|
Returns
Inequality(Length, Length)
Declaration
public static bool operator !=(Length lhs, Length rhs)
Parameters
Returns