/// <summary> /// Creates the quantity with the given numeric value and unit. /// </summary> /// <param name="numericValue">The numeric value to contruct this quantity with.</param> /// <param name="unit">The unit representation to contruct this quantity with.</param> /// <remarks>Value parameter cannot be named 'value' due to constraint when targeting Windows Runtime Component.</remarks> /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception> private Information(decimal numericValue, InformationUnit unit) { if (unit == InformationUnit.Undefined) { throw new ArgumentException("The quantity can not be created with an undefined unit.", nameof(unit)); } _value = numericValue; _unit = unit; }
public Information(double bits) { _value = Convert.ToDecimal(bits); _unit = BaseUnit; }
/// <summary> /// Creates the quantity with a value of 0 in the base unit Bit. /// </summary> /// <remarks> /// Windows Runtime Component requires a default constructor. /// </remarks> public Information() { _value = 0; _unit = BaseUnit; }
Information(decimal numericValue, InformationUnit unit) { _value = numericValue; _unit = unit; }