/// <summary> /// Creates a new instance of a unit with a given multiple factor /// to it's base unit. /// Base units are the SI units, either base or derived. /// See the special implementation for details. /// </summary> /// <param name="multiple">The multiple of the base unit</param> /// <param name="baseUnit">The base unit for this unit</param> /// <exception cref="ArgumentNullException">Thrown, if either <paramref name="multiple"/> or <paramref name="baseUnit"/> is null.</exception> protected UnitBase(Multiple multiple, UnitBase baseUnit) : this(multiple.Factor, multiple.Symbol + baseUnit.Symbol) { if (Multiple == null) { throw new ArgumentNullException("multiple"); } if (baseUnit == null) { throw new ArgumentNullException("baseUnit"); } this.multiple = multiple; }
/// <summary> /// Creates multiples of the base unit, here gram. /// </summary> /// <param name="multiple">The multiple to apply to the base unit of gram.</param> public Gram(Multiple multiple) : base(multiple, new Gram()) { }
/// <summary> /// Creats an new unit of a multiple of Volt /// </summary> /// <param name="multiple">The multiple that shall be applied to Volt.</param> public Volt(Multiple multiple) : base(multiple, new Volt()) { }
/// <summary> /// Creates a multiple of 1 litre. /// </summary> /// <param name="multiple">The multiple to be applied to 1 litre.</param> public Litre(Multiple multiple) : base(multiple, new Litre()) { }
/// <summary> /// Constructor for base units. /// </summary> /// <param name="multiple">The multiple that shall be applied to the base unit</param> public Coulomb(Multiple multiple) : base(multiple, new Coulomb()) { }
/// <summary> /// Creates a new instance of a generic unit. /// </summary> /// <param name="multiple">The multiple to the base unit.</param> public GenericUnit(Multiple multiple) : base(multiple, new GenericUnit()) { }
/// <summary> /// Creates multiples of the base unit, here second /// </summary> /// <param name="multiple">The multiple to apply to the unit of seconds.</param> public Second(Multiple multiple) : base(multiple, new Second()) { }
/// <summary> /// Creates a new instance of 1 Ohm. /// </summary> /// <param name="multiple">The multiple that shall be applied to the unit.</param> public Ohm(Multiple multiple) : base(multiple, new Ohm()) { }
/// <summary> /// Creates a new multiple of Farad. /// </summary> /// <param name="multiple">The multiple of the unit.</param> public Farad(Multiple multiple) : base(multiple, new Farad()) { }
/// <summary> /// Creates a new instance of a current unit. /// </summary> /// <param name="multiple">The multiple to the base unit.</param> public Ampere(Multiple multiple) : base(multiple, new Ampere()) { }
/// <summary> /// Creates multiples of the base unit, here meter /// </summary> /// <param name="multiple">The multiple to apply to the base unit of meters.</param> /// <param name="unit">The unit the multiple shall be applied to.</param> protected LengthUnit(Multiple multiple, LengthUnit unit) : base(multiple, unit) { }
/// <summary> /// Creates a new instance of a current unit. /// </summary> /// <param name="multiple">The multiple to the base unit.</param> /// <param name="currentUnit">The unit the multiple shall be applied to.</param> protected CurrentUnit(Multiple multiple, CurrentUnit currentUnit) : base(multiple, currentUnit) { }
/// <summary> /// Creates a new instance of the unit of 1 Henry /// </summary> /// <param name="multiple">The multiple that shall be applied to the base unit</param> public Henry(Multiple multiple) : base(multiple, new Henry()) { }
/// <summary> /// Constructor for base units. /// </summary> /// <param name="multiple">The multiple that shall be applied to the base unit</param> /// <param name="baseUnit">The base unit.</param> protected CoherentUnitBase(Multiple multiple, UnitBase baseUnit) : base(multiple, baseUnit) { }
/// <summary> /// Creates multiples of the base unit, here meter /// </summary> /// <param name="multiple">The multiple to apply to the unit of meters.</param> public Meter(Multiple multiple) : base(multiple, new Meter()) { }
/// <summary> /// Creats an new unit of a multiple of Watt /// </summary> /// <param name="multiple">The multiple that shall be applied to Watt.</param> public Watt(Multiple multiple) : base(multiple, new Watt()) { }
/// <summary> /// Creates a new unit of 1 rotation, which is equivalent to 2 pi rad. /// </summary> public RotationUnit(Multiple multiple) : base(multiple, new RotationUnit()) { }
/// <summary> /// Creates an new multiple of a ton. /// </summary> /// <param name="multiple">The multiple that shall be applied to ton. Should be > 10 only.</param> public Ton(Multiple multiple) : base(multiple, new Ton()) { }