Class Currency
Currency.
Namespace: StockSharp.Messages
Assembly: StockSharp.Messages.dll
Syntax
public class Currency : Equatable<Currency>
Constructors
Currency()
Initializes a new instance of the Currency.
Declaration
public Currency()
Properties
Type
Currency type. The default is StockSharp.Messages.CurrencyTypes.RUB.
Declaration
public CurrencyTypes Type { get; set; }
Property Value
Type | Description |
---|---|
Ecng.Common.CurrencyTypes |
Value
Absolute value in StockSharp.Messages.CurrencyTypes.
Declaration
public Decimal Value { get; set; }
Property Value
Type | Description |
---|---|
Decimal |
Methods
Clone()
Create a copy of Currency.
Declaration
public override Currency Clone()
Returns
Type | Description |
---|---|
Currency | Copy. |
GetHashCode()
Get the hash code of the object Currency.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code. |
OnEquals(Currency)
Compare Currency on the equivalence.
Declaration
protected override bool OnEquals(Currency other)
Parameters
Type | Name | Description |
---|---|---|
Currency | other | Another value with which to compare. |
Returns
Type | Description |
---|---|
Boolean | true, if the specified object is equal to the current object, otherwise, false. |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Operators
Addition(Currency, Currency)
Add the two objects Currency.
Declaration
public static Currency operator +(Currency c1, Currency c2)
Parameters
Type | Name | Description |
---|---|---|
Currency | c1 | First object Currency. |
Currency | c2 | Second object Currency. |
Returns
Type | Description |
---|---|
Currency | The result of addition. |
Remarks
The values must be the same Type.
Division(Currency, Currency)
Divide one value to another.
Declaration
public static Currency operator /(Currency c1, Currency c2)
Parameters
Type | Name | Description |
---|---|---|
Currency | c1 | First object Currency. |
Currency | c2 | Second object Currency. |
Returns
Type | Description |
---|---|
Currency | The result of the division. |
Explicit(Currency to Decimal)
Declaration
public static explicit operator Decimal(Currency unit)
Parameters
Type | Name | Description |
---|---|---|
Currency | unit | Object Currency. |
Returns
Type | Description |
---|---|
Decimal | Decimal value. |
Implicit(Decimal to Currency)
Declaration
public static implicit operator Currency(Decimal value)
Parameters
Type | Name | Description |
---|---|---|
Decimal | value | Decimal value. |
Returns
Type | Description |
---|---|
Currency | Object Currency. |
Multiply(Currency, Currency)
Multiply one value to another.
Declaration
public static Currency operator *(Currency c1, Currency c2)
Parameters
Type | Name | Description |
---|---|---|
Currency | c1 | First object Currency. |
Currency | c2 | Second object Currency. |
Returns
Type | Description |
---|---|
Currency | The result of the multiplication. |
Subtraction(Currency, Currency)
Subtract one value from another value.
Declaration
public static Currency operator -(Currency c1, Currency c2)
Parameters
Type | Name | Description |
---|---|---|
Currency | c1 | First object Currency. |
Currency | c2 | Second object Currency. |
Returns
Type | Description |
---|---|
Currency | The result of the subtraction. |