Table of Contents

Class Unit

Namespace
StockSharp.Messages
Assembly
StockSharp.Messages.dll

Special class, allows to set the value as a percentage, absolute, points and pips values.

[DataContract]
public class Unit : Equatable<Unit>, IOperable<Unit>, IComparable<Unit>, IPersistable, IFormattable
Inheritance
Unit
Implements
IOperable<Unit>
IPersistable
Extension Methods

Constructors

Unit()

Create unit.

public Unit()

Unit(decimal)

Create absolute value Absolute.

public Unit(decimal value)

Parameters

value decimal

Value.

Unit(decimal, UnitTypes)

Create a value of types Absolute and Percent.

public Unit(decimal value, UnitTypes type)

Parameters

value decimal

Value.

type UnitTypes

Measure unit.

Unit(decimal, UnitTypes, Func<UnitTypes, decimal?>)

Create a value of types Point and Step.

public Unit(decimal value, UnitTypes type, Func<UnitTypes, decimal?> getTypeValue)

Parameters

value decimal

Value.

type UnitTypes

Measure unit.

getTypeValue Func<UnitTypes, decimal?>

The handler returns a value associated with Type (price or volume steps).

Properties

GetTypeValue

The handler returns a value associated with Type (price or volume steps).

public Func<UnitTypes, decimal?> GetTypeValue { get; set; }

Property Value

Func<UnitTypes, decimal?>

Type

Measure unit.

[DataMember]
public UnitTypes Type { get; set; }

Property Value

UnitTypes

Value

Value.

[DataMember]
public decimal Value { get; set; }

Property Value

decimal

Methods

Abs()

Make the value positive.

public Unit Abs()

Returns

Unit

Unit

Clone()

Create a copy of Unit.

public override Unit Clone()

Returns

Unit

Copy.

CompareTo(Unit)

Compare Unit on the equivalence.

public override int CompareTo(Unit other)

Parameters

other Unit

Another value with which to compare.

Returns

int

The result of the comparison.

Convert(UnitTypes, bool)

Cast the value to another type.

public Unit Convert(UnitTypes destinationType, bool throwException = true)

Parameters

destinationType UnitTypes

Destination value type.

throwException bool

Throw exception in case of impossible conversion. Otherwise, returns null.

Returns

Unit

Converted value.

Convert(UnitTypes, Func<UnitTypes, decimal?>, bool)

Cast the value to another type.

public Unit Convert(UnitTypes destinationType, Func<UnitTypes, decimal?> getTypeValue, bool throwException = true)

Parameters

destinationType UnitTypes

Destination value type.

getTypeValue Func<UnitTypes, decimal?>

The handler returns a value associated with Type (price or volume steps).

throwException bool

Throw exception in case of impossible conversion. Otherwise, returns null.

Returns

Unit

Converted value.

Equals(object)

Compare Unit on the equivalence.

public override bool Equals(object other)

Parameters

other object

Another value with which to compare.

Returns

bool

true, if the specified object is equal to the current object, otherwise, false.

GetHashCode()

Get the hash code of the object Unit.

public override int GetHashCode()

Returns

int

A hash code.

GetTypeSuffix(UnitTypes)

Get string suffix.

public static string GetTypeSuffix(UnitTypes type)

Parameters

type UnitTypes

Measure unit.

Returns

string

String suffix.

Load(SettingsStorage)

Load settings.

public void Load(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

OnEquals(Unit)

Compare Unit on the equivalence.

protected override bool OnEquals(Unit other)

Parameters

other Unit

Another value with which to compare.

Returns

bool

true, if the specified object is equal to the current object, otherwise, false.

Save(SettingsStorage)

Save settings.

public void Save(SettingsStorage storage)

Parameters

storage SettingsStorage

Settings storage.

ToString()

public override string ToString()

Returns

string

ToString(string, IFormatProvider)

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string
formatProvider IFormatProvider

Returns

string

Operators

operator +(Unit, Unit)

Add the two objects Unit.

public static Unit operator +(Unit u1, Unit u2)

Parameters

u1 Unit

First object Unit.

u2 Unit

Second object Unit.

Returns

Unit

The result of addition.

operator +(Unit, decimal)

Add the two objects Unit and decimal.

public static Unit operator +(Unit u, decimal d)

Parameters

u Unit

First object Unit.

d decimal

Second object decimal.

Returns

Unit

The result of addition.

operator +(Unit, double)

Add the two objects Unit and double.

public static Unit operator +(Unit u, double d)

Parameters

u Unit

First object Unit.

d double

Second object double.

Returns

Unit

The result of addition.

operator +(Unit, int)

Add the two objects Unit and int.

public static Unit operator +(Unit u, int i)

Parameters

u Unit

First object Unit.

i int

Second object int.

Returns

Unit

The result of addition.

operator +(Unit, long)

Add the two objects Unit and long.

public static Unit operator +(Unit u, long l)

Parameters

u Unit

First object Unit.

l long

Second object long.

Returns

Unit

The result of addition.

operator +(decimal, Unit)

Add the two objects Unit and decimal.

public static Unit operator +(decimal d, Unit u)

Parameters

d decimal

First object decimal.

u Unit

Second object Unit.

Returns

Unit

The result of addition.

operator +(double, Unit)

Add the two objects Unit and double.

public static Unit operator +(double d, Unit u)

Parameters

d double

First object double.

u Unit

Second object Unit.

Returns

Unit

The result of addition.

operator +(int, Unit)

Add the two objects Unit and int.

public static Unit operator +(int i, Unit u)

Parameters

i int

First object int.

u Unit

Second object Unit.

Returns

Unit

The result of addition.

operator +(long, Unit)

Add the two objects Unit and long.

public static Unit operator +(long l, Unit u)

Parameters

l long

First object long.

u Unit

Second object Unit.

Returns

Unit

The result of addition.

operator /(Unit, Unit)

Divide the unit Unit to another.

public static Unit operator /(Unit u1, Unit u2)

Parameters

u1 Unit

First object Unit.

u2 Unit

Second object Unit.

Returns

Unit

The result of the division.

operator /(Unit, decimal)

Divide a Unit by a decimal.

public static Unit operator /(Unit u, decimal d)

Parameters

u Unit

First object Unit.

d decimal

Second object decimal.

Returns

Unit

The result of division.

operator /(Unit, double)

Divide a Unit by a double.

public static Unit operator /(Unit u, double d)

Parameters

u Unit

First object Unit.

d double

Second object double.

Returns

Unit

The result of division.

operator /(Unit, int)

Divide a Unit by an int.

public static Unit operator /(Unit u, int i)

Parameters

u Unit

First object Unit.

i int

Second object int.

Returns

Unit

The result of division.

operator /(Unit, long)

Divide a Unit by a long.

public static Unit operator /(Unit u, long l)

Parameters

u Unit

First object Unit.

l long

Second object long.

Returns

Unit

The result of division.

operator /(decimal, Unit)

Divide a decimal by a Unit.

public static Unit operator /(decimal d, Unit u)

Parameters

d decimal

First object decimal.

u Unit

Second object Unit.

Returns

Unit

The result of division.

operator /(double, Unit)

Divide a double by a Unit.

public static Unit operator /(double d, Unit u)

Parameters

d double

First object double.

u Unit

Second object Unit.

Returns

Unit

The result of division.

operator /(int, Unit)

Divide an int by a Unit.

public static Unit operator /(int i, Unit u)

Parameters

i int

First object int.

u Unit

Second object Unit.

Returns

Unit

The result of division.

operator /(long, Unit)

Divide a long by a Unit.

public static Unit operator /(long l, Unit u)

Parameters

l long

First object long.

u Unit

Second object Unit.

Returns

Unit

The result of division.

operator ==(Unit, Unit)

Compare two values for equality (if the value of different types, the conversion will be used).

public static bool operator ==(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the values are equals, otherwise, false.

operator ==(Unit, decimal)

Check whether the Unit is equal to a decimal.

public static bool operator ==(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is equal to the decimal, false.

operator ==(Unit, double)

Check whether the Unit is equal to a double.

public static bool operator ==(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is equal to the double, false.

operator ==(Unit, int)

Check whether the Unit is equal to an int.

public static bool operator ==(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is equal to the int, false.

operator ==(Unit, long)

Check whether the Unit is equal to a long.

public static bool operator ==(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is equal to the long, false.

operator ==(decimal, Unit)

Check whether the decimal is equal to a Unit.

public static bool operator ==(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is equal to the Unit, false.

operator ==(double, Unit)

Check whether the double is equal to a Unit.

public static bool operator ==(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is equal to the Unit, false.

operator ==(int, Unit)

Check whether the int is equal to a Unit.

public static bool operator ==(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is equal to the Unit, false.

operator ==(long, Unit)

Check whether the long is equal to a Unit.

public static bool operator ==(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is equal to the Unit, false.

explicit operator decimal(Unit)

Cast object from Unit to decimal.

public static explicit operator decimal(Unit unit)

Parameters

unit Unit

Object Unit.

Returns

decimal

decimal value.

explicit operator double(Unit)

Cast object from Unit to double.

public static explicit operator double(Unit unit)

Parameters

unit Unit

Object Unit.

Returns

double

double value.

explicit operator decimal?(Unit)

Cast object from Unit to nullable decimal.

public static explicit operator decimal?(Unit unit)

Parameters

unit Unit

Object Unit.

Returns

decimal?

decimal value.

explicit operator double?(Unit)

Cast object from Unit to nullable double.

public static explicit operator double?(Unit unit)

Parameters

unit Unit

Object Unit.

Returns

double?

double value.

operator >(Unit, Unit)

Check whether the first value is greater than the second.

public static bool operator >(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the first value is greater than the second, false.

operator >(Unit, decimal)

Check whether the Unit is greater than a decimal.

public static bool operator >(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is greater than the decimal, false.

operator >(Unit, double)

Check whether the Unit is greater than a double.

public static bool operator >(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is greater than the double, false.

operator >(Unit, int)

Check whether the Unit is greater than an int.

public static bool operator >(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is greater than the int, false.

operator >(Unit, long)

Check whether the Unit is greater than a long.

public static bool operator >(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is greater than the long, false.

operator >(decimal, Unit)

Check whether the decimal is greater than a Unit.

public static bool operator >(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is greater than the Unit, false.

operator >(double, Unit)

Check whether the double is greater than a Unit.

public static bool operator >(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is greater than the Unit, false.

operator >(int, Unit)

Check whether the int is greater than a Unit.

public static bool operator >(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is greater than the Unit, false.

operator >(long, Unit)

Check whether the long is greater than a Unit.

public static bool operator >(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is greater than the Unit, false.

operator >=(Unit, Unit)

Check whether the first value is greater than or equal to the second.

public static bool operator >=(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the first value is greater than or equal the second, otherwise, false.

operator >=(Unit, decimal)

Check whether the Unit is greater than or equal to a decimal.

public static bool operator >=(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is greater than or equal to the decimal, false.

operator >=(Unit, double)

Check whether the Unit is greater than or equal to a double.

public static bool operator >=(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is greater than or equal to the double, false.

operator >=(Unit, int)

Check whether the Unit is greater than or equal to an int.

public static bool operator >=(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is greater than or equal to the int, false.

operator >=(Unit, long)

Check whether the Unit is greater than or equal to a long.

public static bool operator >=(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is greater than or equal to the long, false.

operator >=(decimal, Unit)

Check whether the decimal is greater than or equal to a Unit.

public static bool operator >=(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is greater than or equal to the Unit, false.

operator >=(double, Unit)

Check whether the double is greater than or equal to a Unit.

public static bool operator >=(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is greater than or equal to the Unit, false.

operator >=(int, Unit)

Check whether the int is greater than or equal to a Unit.

public static bool operator >=(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is greater than or equal to the Unit, false.

operator >=(long, Unit)

Check whether the long is greater than or equal to a Unit.

public static bool operator >=(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is greater than or equal to the Unit, false.

implicit operator Unit(decimal)

Cast decimal object to the type Unit.

public static implicit operator Unit(decimal value)

Parameters

value decimal

decimal value.

Returns

Unit

Object Unit.

implicit operator Unit(double)

Cast double object to the type Unit.

public static implicit operator Unit(double value)

Parameters

value double

double value.

Returns

Unit

Object Unit.

implicit operator Unit(int)

Cast int object to the type Unit.

public static implicit operator Unit(int value)

Parameters

value int

int value.

Returns

Unit

Object Unit.

implicit operator Unit(long)

Cast long object to the type Unit.

public static implicit operator Unit(long value)

Parameters

value long

long value.

Returns

Unit

Object Unit.

operator !=(Unit, Unit)

Compare two values in the inequality (if the value of different types, the conversion will be used).

public static bool operator !=(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the values are equals, otherwise, false.

operator !=(Unit, decimal)

Check whether the Unit is not equal to a decimal.

public static bool operator !=(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is not equal to the decimal, false.

operator !=(Unit, double)

Check whether the Unit is not equal to a double.

public static bool operator !=(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is not equal to the double, false.

operator !=(Unit, int)

Check whether the Unit is not equal to an int.

public static bool operator !=(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is not equal to the int, false.

operator !=(Unit, long)

Check whether the Unit is not equal to a long.

public static bool operator !=(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is not equal to the long, false.

operator !=(decimal, Unit)

Check whether the decimal is not equal to a Unit.

public static bool operator !=(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is not equal to the Unit, false.

operator !=(double, Unit)

Check whether the double is not equal to a Unit.

public static bool operator !=(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is not equal to the Unit, false.

operator !=(int, Unit)

Check whether the int is not equal to a Unit.

public static bool operator !=(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is not equal to the Unit, false.

operator !=(long, Unit)

Check whether the long is not equal to a Unit.

public static bool operator !=(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is not equal to the Unit, false.

operator <(Unit, Unit)

Check whether the first value is less than the second.

public static bool operator <(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the first value is less than the second, false.

operator <(Unit, decimal)

Check whether the Unit is less than a decimal.

public static bool operator <(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is less than the decimal, false.

operator <(Unit, double)

Check whether the Unit is less than a double.

public static bool operator <(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is less than the double, false.

operator <(Unit, int)

Check whether the Unit is less than an int.

public static bool operator <(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is less than the int, false.

operator <(Unit, long)

Check whether the Unit is less than a long.

public static bool operator <(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is less than the long, false.

operator <(decimal, Unit)

Check whether the decimal is less than a Unit.

public static bool operator <(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is less than the Unit, false.

operator <(double, Unit)

Check whether the double is less than a Unit.

public static bool operator <(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is less than the Unit, false.

operator <(int, Unit)

Check whether the int is less than a Unit.

public static bool operator <(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is less than the Unit, false.

operator <(long, Unit)

Check whether the long is less than a Unit.

public static bool operator <(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is less than the Unit, false.

operator <=(Unit, Unit)

Check whether the first value is less than or equal to the second.

public static bool operator <=(Unit u1, Unit u2)

Parameters

u1 Unit

First unit.

u2 Unit

Second unit.

Returns

bool

true, if the first value is less than or equal to the second, false.

operator <=(Unit, decimal)

Check whether the Unit is less than or equal to a decimal.

public static bool operator <=(Unit u, decimal d)

Parameters

u Unit

The Unit to compare.

d decimal

The decimal to compare.

Returns

bool

true, if the Unit is less than or equal to the decimal, false.

operator <=(Unit, double)

Check whether the Unit is less than or equal to a double.

public static bool operator <=(Unit u, double d)

Parameters

u Unit

The Unit to compare.

d double

The double to compare.

Returns

bool

true, if the Unit is less than or equal to the double, false.

operator <=(Unit, int)

Check whether the Unit is less than or equal to an int.

public static bool operator <=(Unit u, int i)

Parameters

u Unit

The Unit to compare.

i int

The int to compare.

Returns

bool

true, if the Unit is less than or equal to the int, false.

operator <=(Unit, long)

Check whether the Unit is less than or equal to a long.

public static bool operator <=(Unit u, long l)

Parameters

u Unit

The Unit to compare.

l long

The long to compare.

Returns

bool

true, if the Unit is less than or equal to the long, false.

operator <=(decimal, Unit)

Check whether the decimal is less than or equal to a Unit.

public static bool operator <=(decimal d, Unit u)

Parameters

d decimal

The decimal to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the decimal is less than or equal to the Unit, false.

operator <=(double, Unit)

Check whether the double is less than or equal to a Unit.

public static bool operator <=(double d, Unit u)

Parameters

d double

The double to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the double is less than or equal to the Unit, false.

operator <=(int, Unit)

Check whether the int is less than or equal to a Unit.

public static bool operator <=(int i, Unit u)

Parameters

i int

The int to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the int is less than or equal to the Unit, false.

operator <=(long, Unit)

Check whether the long is less than or equal to a Unit.

public static bool operator <=(long l, Unit u)

Parameters

l long

The long to compare.

u Unit

The Unit to compare.

Returns

bool

true, if the long is less than or equal to the Unit, false.

operator *(Unit, Unit)

Multiply the two objects Unit.

public static Unit operator *(Unit u1, Unit u2)

Parameters

u1 Unit

First object Unit.

u2 Unit

Second object Unit.

Returns

Unit

The result of the multiplication.

operator *(Unit, decimal)

Multiply a Unit by a decimal.

public static Unit operator *(Unit u, decimal d)

Parameters

u Unit

First object Unit.

d decimal

Second object decimal.

Returns

Unit

The result of multiplication.

operator *(Unit, double)

Multiply a Unit by a double.

public static Unit operator *(Unit u, double d)

Parameters

u Unit

First object Unit.

d double

Second object double.

Returns

Unit

The result of multiplication.

operator *(Unit, int)

Multiply a Unit by an int.

public static Unit operator *(Unit u, int i)

Parameters

u Unit

First object Unit.

i int

Second object int.

Returns

Unit

The result of multiplication.

operator *(Unit, long)

Multiply a Unit by a long.

public static Unit operator *(Unit u, long l)

Parameters

u Unit

First object Unit.

l long

Second object long.

Returns

Unit

The result of multiplication.

operator *(decimal, Unit)

Multiply a decimal by a Unit.

public static Unit operator *(decimal d, Unit u)

Parameters

d decimal

First object decimal.

u Unit

Second object Unit.

Returns

Unit

The result of multiplication.

operator *(double, Unit)

Multiply a double by a Unit.

public static Unit operator *(double d, Unit u)

Parameters

d double

First object double.

u Unit

Second object Unit.

Returns

Unit

The result of multiplication.

operator *(int, Unit)

Multiply an int by a Unit.

public static Unit operator *(int i, Unit u)

Parameters

i int

First object int.

u Unit

Second object Unit.

Returns

Unit

The result of multiplication.

operator *(long, Unit)

Multiply a long by a Unit.

public static Unit operator *(long l, Unit u)

Parameters

l long

First object long.

u Unit

Second object Unit.

Returns

Unit

The result of multiplication.

operator -(Unit, Unit)

Subtract the unit Unit from another.

public static Unit operator -(Unit u1, Unit u2)

Parameters

u1 Unit

First object Unit.

u2 Unit

Second object Unit.

Returns

Unit

The result of the subtraction.

operator -(Unit, decimal)

Subtract a decimal from a Unit.

public static Unit operator -(Unit u, decimal d)

Parameters

u Unit

First object Unit.

d decimal

Second object decimal.

Returns

Unit

The result of subtraction.

operator -(Unit, double)

Subtract a double from a Unit.

public static Unit operator -(Unit u, double d)

Parameters

u Unit

First object Unit.

d double

Second object double.

Returns

Unit

The result of subtraction.

operator -(Unit, int)

Subtract an int from a Unit.

public static Unit operator -(Unit u, int i)

Parameters

u Unit

First object Unit.

i int

Second object int.

Returns

Unit

The result of subtraction.

operator -(Unit, long)

Subtract a long from a Unit.

public static Unit operator -(Unit u, long l)

Parameters

u Unit

First object Unit.

l long

Second object long.

Returns

Unit

The result of subtraction.

operator -(decimal, Unit)

Subtract the Unit from a decimal.

public static Unit operator -(decimal d, Unit u)

Parameters

d decimal

First object decimal.

u Unit

Second object Unit.

Returns

Unit

The result of subtraction.

operator -(double, Unit)

Subtract the Unit from a double.

public static Unit operator -(double d, Unit u)

Parameters

d double

First object double.

u Unit

Second object Unit.

Returns

Unit

The result of subtraction.

operator -(int, Unit)

Subtract the Unit from an int.

public static Unit operator -(int i, Unit u)

Parameters

i int

First object int.

u Unit

Second object Unit.

Returns

Unit

The result of subtraction.

operator -(long, Unit)

Subtract the Unit from a long.

public static Unit operator -(long l, Unit u)

Parameters

l long

First object long.

u Unit

Second object Unit.

Returns

Unit

The result of subtraction.

operator -(Unit)

Get the value with the opposite sign from the value Value.

public static Unit operator -(Unit u)

Parameters

u Unit

Unit.

Returns

Unit

Opposite value.