Пример #1
0
 /// <summary>
 ///     Dynamically convert from value and unit enum <see cref="PowerRatioUnit" /> to <see cref="PowerRatio" />.
 /// </summary>
 /// <param name="value">Value to convert from.</param>
 /// <param name="fromUnit">Unit to convert from.</param>
 /// <returns>PowerRatio unit value.</returns>
 public static PowerRatio From(QuantityValue value, PowerRatioUnit fromUnit)
 {
     return(new PowerRatio((double)value, fromUnit));
 }
Пример #2
0
 /// <summary>
 ///     Dynamically convert from value and unit enum <see cref="DurationUnit" /> to <see cref="Duration" />.
 /// </summary>
 /// <param name="value">Value to convert from.</param>
 /// <param name="fromUnit">Unit to convert from.</param>
 /// <returns>Duration unit value.</returns>
 public static Duration From(QuantityValue value, DurationUnit fromUnit)
 {
     return(new Duration((double)value, fromUnit));
 }
Пример #3
0
        /// <summary>
        ///     Get PowerRatio from DecibelWatts.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static PowerRatio FromDecibelWatts(QuantityValue decibelwatts)
        {
            double value = (double)decibelwatts;

            return(new PowerRatio(value, PowerRatioUnit.DecibelWatt));
        }
Пример #4
0
        /// <summary>
        ///     Get Duration from Weeks.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromWeeks(QuantityValue weeks)
        {
            double value = (double)weeks;

            return(new Duration(value, DurationUnit.Week));
        }
Пример #5
0
        /// <summary>
        ///     Get Duration from Years365.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromYears365(QuantityValue years365)
        {
            double value = (double)years365;

            return(new Duration(value, DurationUnit.Year365));
        }
Пример #6
0
        /// <summary>
        ///     Get Duration from Nanoseconds.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromNanoseconds(QuantityValue nanoseconds)
        {
            double value = (double)nanoseconds;

            return(new Duration(value, DurationUnit.Nanosecond));
        }
Пример #7
0
        /// <summary>
        ///     Get Duration from Seconds.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromSeconds(QuantityValue seconds)
        {
            double value = (double)seconds;

            return(new Duration(value, DurationUnit.Second));
        }
Пример #8
0
        /// <summary>
        ///     Get Duration from Minutes.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromMinutes(QuantityValue minutes)
        {
            double value = (double)minutes;

            return(new Duration(value, DurationUnit.Minute));
        }
Пример #9
0
        /// <summary>
        ///     Get Duration from Months30.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromMonths30(QuantityValue months30)
        {
            double value = (double)months30;

            return(new Duration(value, DurationUnit.Month30));
        }
Пример #10
0
        /// <summary>
        ///     Get Duration from Hours.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromHours(QuantityValue hours)
        {
            double value = (double)hours;

            return(new Duration(value, DurationUnit.Hour));
        }
Пример #11
0
        /// <summary>
        ///     Get Duration from Milliseconds.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromMilliseconds(QuantityValue milliseconds)
        {
            double value = (double)milliseconds;

            return(new Duration(value, DurationUnit.Millisecond));
        }
Пример #12
0
        /// <summary>
        ///     Get Duration from Days.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static Duration FromDays(QuantityValue days)
        {
            double value = (double)days;

            return(new Duration(value, DurationUnit.Day));
        }
 /// <summary>
 ///     Dynamically convert from value and unit enum <see cref="HeatTransferCoefficientUnit" /> to <see cref="HeatTransferCoefficient" />.
 /// </summary>
 /// <param name="value">Value to convert from.</param>
 /// <param name="fromUnit">Unit to convert from.</param>
 /// <returns>HeatTransferCoefficient unit value.</returns>
 public static HeatTransferCoefficient From(QuantityValue value, HeatTransferCoefficientUnit fromUnit)
 {
     return(new HeatTransferCoefficient((double)value, fromUnit));
 }
        /// <summary>
        ///     Get HeatTransferCoefficient from WattsPerSquareMeterKelvin.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static HeatTransferCoefficient FromWattsPerSquareMeterKelvin(QuantityValue wattspersquaremeterkelvin)
        {
            double value = (double)wattspersquaremeterkelvin;

            return(new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterKelvin));
        }
        /// <summary>
        ///     Get HeatTransferCoefficient from WattsPerSquareMeterCelsius.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static HeatTransferCoefficient FromWattsPerSquareMeterCelsius(QuantityValue wattspersquaremetercelsius)
        {
            double value = (double)wattspersquaremetercelsius;

            return(new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.WattPerSquareMeterCelsius));
        }
        /// <summary>
        ///     Get HeatTransferCoefficient from BtusPerSquareFootDegreeFahrenheit.
        /// </summary>
        /// <exception cref="ArgumentException">If value is NaN or Infinity.</exception>
        public static HeatTransferCoefficient FromBtusPerSquareFootDegreeFahrenheit(QuantityValue btuspersquarefootdegreefahrenheit)
        {
            double value = (double)btuspersquarefootdegreefahrenheit;

            return(new HeatTransferCoefficient(value, HeatTransferCoefficientUnit.BtuPerSquareFootDegreeFahrenheit));
        }