コード例 #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 EnergyUnit(string name, string symbol, decimal amount = 1, EnergyUnit reference = null) :
     base(name, symbol, amount, reference)
 {
 }
コード例 #2
0
 static EnergyUnit()
 {
     kWh   = new EnergyUnit("kWh", "kWh");
     Joule = new EnergyUnit("Joule", "J", 0.0000002778m);
 }