Class PrefixUnit
Represents the base class from which all implementations of a unit of measurement should derive. Implements the IPrefixUnit
Namespace: Cuemon
Assembly: Cuemon.Core.dll
Syntax
public abstract class PrefixUnit : IPrefixUnit, IUnit, IEquatable<IUnit>
Constructors
| Improve this Doc View SourcePrefixUnit(String, String, Double, IPrefixMultiple, Action<UnitFormatOptions>)
Initializes a new instance of the ByteUnit struct.
Declaration
protected PrefixUnit(string name, string symbol, double value, IPrefixMultiple prefix, Action<UnitFormatOptions> setup = null)
Parameters
Type | Name | Description |
---|---|---|
String | name | The name of the unit. |
String | symbol | The symbol of the unit. |
Double | value | The value of this unit expressed as bytes. |
IPrefixMultiple | prefix | The prefix to associate with this unit. |
Action<UnitFormatOptions> | setup | The UnitFormatOptions which may be configured. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentException |
|
ArgumentOutOfRangeException |
|
Properties
| Improve this Doc View SourcePrefix
Gets the prefix multiple to this unit.
Declaration
public IPrefixMultiple Prefix { get; }
Property Value
Type | Description |
---|---|
IPrefixMultiple | The prefix multiple to this unit. |
PrefixValue
Gets the prefix value of this unit.
Declaration
public double PrefixValue { get; }
Property Value
Type | Description |
---|---|
Double | The prefix value of this unit. |
UnitName
Gets the name of this unit.
Declaration
public string UnitName { get; }
Property Value
Type | Description |
---|---|
String | The name of this unit. |
UnitSymbol
Gets the symbol of this unit.
Declaration
public string UnitSymbol { get; }
Property Value
Type | Description |
---|---|
String | The symbol of this unit. |
UnitValue
Gets the value of this unit expressed as bytes.
Declaration
public double UnitValue { get; }
Property Value
Type | Description |
---|---|
Double | The value of this unit. |
Methods
| Improve this Doc View SourceEquals(IUnit)
Indicates whether the current object is equal to another object of the same type.
Declaration
public virtual bool Equals(IUnit other)
Parameters
Type | Name | Description |
---|---|---|
IUnit | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
Boolean |
|
ToString()
Returns a String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A String that represents this instance. |
Overrides
| Improve this Doc View SourceToString(Action<UnitFormatOptions>)
Returns a String that represents this instance.
Declaration
public string ToString(Action<UnitFormatOptions> setup)
Parameters
Type | Name | Description |
---|---|---|
Action<UnitFormatOptions> | setup | The UnitFormatOptions which may be configured. |
Returns
Type | Description |
---|---|
String | A String that represents this instance. |