Show / Hide Table of Contents

Struct UnitValue

A value in units.

Implements
System.IComparable
Inherited Members
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: System.Windows.Controls.DataVisualization
Assembly: OpenSilver.Controls.DataVisualization.Toolkit.dll
Syntax
public struct UnitValue : IComparable

Constructors

| Improve this Doc View Source

UnitValue(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 Source

Unit

Gets the units associated with the value.

Declaration
public Unit Unit { readonly get; }
Property Value
Type Description
Unit
| Improve this Doc View Source

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 Source

CompareTo(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.

| Improve this Doc View Source

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
System.ValueType.Equals(System.Object)
| Improve this Doc View Source

GetHashCode()

Returns the hash code of the unit value object.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

The hash code.

Overrides
System.ValueType.GetHashCode()
| Improve this Doc View Source

NaN()

Returns a UnitValue representing an invalid value.

Declaration
public static UnitValue NaN()
Returns
Type Description
UnitValue

UnitValue instance.

Operators

| Improve this Doc View Source

Equality(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Implements

System.IComparable
  • Improve this Doc
  • View Source