Struct Distance
Represents length distance with unit type.
All operations are done with precision of 1 micrometer (10^(-3) mm)
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
Syntax
public struct Distance : IEquatable<Distance>, IComparable<Distance>, IJSONWritable
Constructors
Distance(Decimal, Distance.UnitType)
Declaration
public Distance(decimal value, Distance.UnitType unit)
Parameters
Fields
MM_IN_CM
Declaration
public const decimal MM_IN_CM = 10.0M
Field Value
Type |
Description |
System.Decimal |
|
MM_IN_FT
Declaration
public const decimal MM_IN_FT = 304.8M
Field Value
Type |
Description |
System.Decimal |
|
MM_IN_IN
Declaration
public const decimal MM_IN_IN = 25.4M
Field Value
Type |
Description |
System.Decimal |
|
MM_IN_M
Declaration
public const decimal MM_IN_M = 1000.0M
Field Value
Type |
Description |
System.Decimal |
|
MM_IN_YD
Declaration
public const decimal MM_IN_YD = 914.4M
Field Value
Type |
Description |
System.Decimal |
|
Unit
Declaration
public readonly Distance.UnitType Unit
Field Value
Value
Declaration
public readonly decimal Value
Field Value
Type |
Description |
System.Decimal |
|
VALUE_PRECISION
Declaration
public const int VALUE_PRECISION = 3
Field Value
Type |
Description |
System.Int32 |
|
ValueInMm
Declaration
public readonly decimal ValueInMm
Field Value
Type |
Description |
System.Decimal |
|
Properties
UnitName
Declaration
public string UnitName { get; }
Property Value
Type |
Description |
System.String |
|
Methods
CompareTo(Distance)
Declaration
public int CompareTo(Distance other)
Parameters
Returns
Type |
Description |
System.Int32 |
|
Convert(Distance.UnitType)
Declaration
public Distance Convert(Distance.UnitType toUnit)
Parameters
Returns
Equals(Distance)
Declaration
public bool Equals(Distance other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.ValueType.Equals(System.Object)
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.ValueType.GetHashCode()
Parse(String)
Declaration
public static Distance Parse(string val)
Parameters
Type |
Name |
Description |
System.String |
val |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.ValueType.ToString()
TryParse(String, out Nullable<Distance>)
Declaration
public static bool TryParse(string val, out Distance? result)
Parameters
Type |
Name |
Description |
System.String |
val |
|
System.Nullable<Distance> |
result |
|
Returns
Type |
Description |
System.Boolean |
|
ValueIn(Distance.UnitType)
Declaration
public decimal ValueIn(Distance.UnitType toUnit)
Parameters
Returns
Type |
Description |
System.Decimal |
|
WriteAsJSON(TextWriter, Int32, JSONWritingOptions)
Declaration
public void WriteAsJSON(TextWriter wri, int nestingLevel, JSONWritingOptions options = null)
Parameters
Type |
Name |
Description |
System.IO.TextWriter |
wri |
|
System.Int32 |
nestingLevel |
|
JSONWritingOptions |
options |
|
Operators
Addition(Distance, Distance)
Declaration
public static Distance operator +(Distance obj1, Distance obj2)
Parameters
Returns
Division(Distance, Decimal)
Declaration
public static Distance operator /(Distance obj1, decimal obj2)
Parameters
Type |
Name |
Description |
Distance |
obj1 |
|
System.Decimal |
obj2 |
|
Returns
Equality(Distance, Distance)
Declaration
public static bool operator ==(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThan(Distance, Distance)
Declaration
public static bool operator>(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GreaterThanOrEqual(Distance, Distance)
Declaration
public static bool operator >=(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Inequality(Distance, Distance)
Declaration
public static bool operator !=(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThan(Distance, Distance)
Declaration
public static bool operator <(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
LessThanOrEqual(Distance, Distance)
Declaration
public static bool operator <=(Distance obj1, Distance obj2)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Multiply(Distance, Decimal)
Declaration
public static Distance operator *(Distance obj1, decimal obj2)
Parameters
Type |
Name |
Description |
Distance |
obj1 |
|
System.Decimal |
obj2 |
|
Returns
Subtraction(Distance, Distance)
Declaration
public static Distance operator -(Distance obj1, Distance obj2)
Parameters
Returns
Implements
System.IEquatable<T>
System.IComparable<T>
Extension Methods