Esempio n. 1
0
 /// <summary>Constructor</summary>
 /// <param name="name">Name</param>
 /// <param name="symbol">Symbol</param>
 /// <param name="amount">Amount of reference units (1 for the base unit)</param>
 /// <param name="reference">Reference Measure Unit (null for the base unit)</param>
 /// <exception cref="ArgumentException">Amount must be positive</exception>
 /// <exception cref="TypeInitializationException">Created unit and the reference unit must belong to the same measure equivalence class</exception>
 /// <exception cref="TypeInitializationException">First unit of the equivalence class must have rate equal to 1</exception>
 public QuantityUnit(string name, string symbol, decimal amount = 1, QuantityUnit reference = null) :
     base(name, symbol, amount, reference)
 {
 }
Esempio n. 2
0
 static QuantityUnit()
 {
     Item      = new QuantityUnit("Item", "item");
     Dozen     = new QuantityUnit("Dozen", "dozen", 12, Item);
     HalfDozen = new QuantityUnit("Half-Dozen", "half-dozen", 6);
 }