Struct UnitValue
A value in units.
Implements
Inherited Members
Namespace: System.Windows.Controls.DataVisualization
Assembly: Controls.DataVisualization.OpenSilver.dll
Syntax
public struct UnitValue : IComparable
Constructors
| Improve this Doc View SourceUnitValue(Double, Unit)
Instantiates a new instance of the UnitValue struct.
Declaration
public UnitValue(double value, Unit unit)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value associated with the units. |
Unit | unit | The units associated with the value. |
Properties
| Improve this Doc View SourceUnit
Gets the units associated with the value.
Declaration
public Unit Unit { readonly get; }
Property Value
Type | Description |
---|---|
Unit |
Value
Gets the value associated with the units.
Declaration
public double Value { readonly get; }
Property Value
Type | Description |
---|---|
System.Double |
Methods
| Improve this Doc View SourceCompareTo(Object)
Compares two unit values to determine if they are equal or not.
Declaration
public int CompareTo(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object being compared. |
Returns
Type | Description |
---|---|
System.Int32 | A number smaller than zero if the obj is larger than this object. A number equal to 0 if they are equal. A number greater than zero if this unit value is greater than obj. |
Equals(Object)
Determines if two values are equal.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The other value. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether values are equal. |
Overrides
GetHashCode()
Returns the hash code of the unit value object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | The hash code. |
Overrides
NaN()
Returns a UnitValue representing an invalid value.
Declaration
public static UnitValue NaN()
Returns
Type | Description |
---|---|
UnitValue | UnitValue instance. |
Operators
| Improve this Doc View SourceEquality(UnitValue, UnitValue)
Determines whether two unit value objects are equal.
Declaration
public static bool operator ==(UnitValue left, UnitValue right)
Parameters
Type | Name | Description |
---|---|---|
UnitValue | left | The left unit value. |
UnitValue | right | The right unit value. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether two unit value objects are equal. |
GreaterThan(UnitValue, UnitValue)
Determines whether the left value is larger than the right.
Declaration
public static bool operator>(UnitValue left, UnitValue right)
Parameters
Type | Name | Description |
---|---|---|
UnitValue | left | The left unit value. |
UnitValue | right | The right unit value. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the left value is larger than the right. |
Inequality(UnitValue, UnitValue)
Determines whether two unit value objects are not equal.
Declaration
public static bool operator !=(UnitValue left, UnitValue right)
Parameters
Type | Name | Description |
---|---|---|
UnitValue | left | The left unit value. |
UnitValue | right | The right unit value. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether two unit value objects are not equal. |
LessThan(UnitValue, UnitValue)
Determines whether the left value is smaller than the right.
Declaration
public static bool operator <(UnitValue left, UnitValue right)
Parameters
Type | Name | Description |
---|---|---|
UnitValue | left | The left unit value. |
UnitValue | right | The right unit value. |
Returns
Type | Description |
---|---|
System.Boolean | A value indicating whether the left value is smaller than the right. |